@splunk/visualizations 28.5.3 → 28.7.0

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 (663) hide show
  1. package/Area/Area.d.ts.map +1 -1
  2. package/Area/areaUtils.d.ts +1 -1
  3. package/Area/areaUtils.d.ts.map +1 -1
  4. package/Area/config.d.ts.map +1 -1
  5. package/Area.config.js +93 -25
  6. package/Area.config.js.map +3 -3
  7. package/Area.js +708 -319
  8. package/Area.js.map +4 -4
  9. package/Bar/Bar.d.ts.map +1 -1
  10. package/Bar.config.js +81 -24
  11. package/Bar.config.js.map +3 -3
  12. package/Bar.js +528 -297
  13. package/Bar.js.map +4 -4
  14. package/Bubble.config.js +80 -23
  15. package/Bubble.config.js.map +2 -2
  16. package/Bubble.js +375 -208
  17. package/Bubble.js.map +4 -4
  18. package/CHANGELOG.external.md +75 -60
  19. package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts +1 -0
  20. package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
  21. package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts +12 -25
  22. package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts.map +1 -1
  23. package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts +11 -4
  24. package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
  25. package/ChoroplethSvg.js +1133 -253
  26. package/ChoroplethSvg.js.map +4 -4
  27. package/Column/Column.d.ts.map +1 -1
  28. package/Column.config.js +81 -24
  29. package/Column.config.js.map +3 -3
  30. package/Column.js +531 -300
  31. package/Column.js.map +4 -4
  32. package/Ellipse.config.js +1 -1
  33. package/Ellipse.config.js.map +2 -2
  34. package/Ellipse.js +277 -161
  35. package/Ellipse.js.map +4 -4
  36. package/Events/PureEvents/FieldSummaryTooltip.d.ts +8 -31
  37. package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
  38. package/Events/PureEvents/PureEvents.d.ts.map +1 -1
  39. package/Events/PureEvents/TimeControlsPopover.d.ts +6 -25
  40. package/Events/PureEvents/TimeControlsPopover.d.ts.map +1 -1
  41. package/Events/config.d.ts.map +1 -1
  42. package/Events.config.js +13 -3
  43. package/Events.config.js.map +2 -2
  44. package/Events.js +355 -293
  45. package/Events.js.map +4 -4
  46. package/FillerGauge/FillerGauge.d.ts.map +1 -1
  47. package/FillerGauge/config.d.ts.map +1 -1
  48. package/FillerGauge.config.js +76 -24
  49. package/FillerGauge.config.js.map +2 -2
  50. package/FillerGauge.js +512 -271
  51. package/FillerGauge.js.map +4 -4
  52. package/Image/config.d.ts.map +1 -1
  53. package/Image.config.js +7 -0
  54. package/Image.config.js.map +2 -2
  55. package/Image.js +282 -149
  56. package/Image.js.map +4 -4
  57. package/LICENSE +13 -0
  58. package/Line/Line.d.ts.map +1 -1
  59. package/Line/config.d.ts.map +1 -1
  60. package/Line/lineUtils.d.ts.map +1 -1
  61. package/Line/mockdata/LineData.d.ts +21 -0
  62. package/Line/mockdata/LineData.d.ts.map +1 -1
  63. package/Line.config.js +86 -25
  64. package/Line.config.js.map +3 -3
  65. package/Line.js +638 -382
  66. package/Line.js.map +4 -4
  67. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +47 -73
  68. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
  69. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts +11 -2
  70. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
  71. package/LinkGraph/PureLinkGraph/components/Graph.d.ts +5 -5
  72. package/LinkGraph/PureLinkGraph/components/Node.d.ts +2 -2
  73. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +2 -2
  74. package/LinkGraph.js +886 -759
  75. package/LinkGraph.js.map +4 -4
  76. package/Map/Map.d.ts +1 -0
  77. package/Map/Map.d.ts.map +1 -1
  78. package/Map/PureMap/BubbleLayer.d.ts +22 -4
  79. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  80. package/Map/PureMap/ChoroplethLayer.d.ts +9 -1
  81. package/Map/PureMap/ChoroplethLayer.d.ts.map +1 -1
  82. package/Map/PureMap/ClusterLayer.d.ts +3 -1
  83. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  84. package/Map/PureMap/LocalChoroplethLayer.d.ts +1 -0
  85. package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
  86. package/Map/PureMap/MapContext.d.ts +13 -0
  87. package/Map/PureMap/MapContext.d.ts.map +1 -0
  88. package/Map/PureMap/MarkerLayer.d.ts +19 -2
  89. package/Map/PureMap/MarkerLayer.d.ts.map +1 -1
  90. package/Map/PureMap/MarkerWrapper.d.ts +3 -2
  91. package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
  92. package/Map/PureMap/PureMap.d.ts +1 -0
  93. package/Map/PureMap/PureMap.d.ts.map +1 -1
  94. package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
  95. package/Map/PureMap/Tooltip.d.ts +6 -1
  96. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  97. package/Map/PureMap/keyboardConstants.d.ts +11 -0
  98. package/Map/PureMap/keyboardConstants.d.ts.map +1 -0
  99. package/Map/PureMap/useRovingTabindex.d.ts +18 -0
  100. package/Map/PureMap/useRovingTabindex.d.ts.map +1 -0
  101. package/Map/config.d.ts.map +1 -1
  102. package/Map.config.js +4 -1
  103. package/Map.config.js.map +2 -2
  104. package/Map.js +1594 -628
  105. package/Map.js.map +4 -4
  106. package/Markdown/Markdown.d.ts.map +1 -1
  107. package/Markdown.config.js.map +1 -1
  108. package/Markdown.js +304 -161
  109. package/Markdown.js.map +4 -4
  110. package/MarkerGauge/MarkerGauge.d.ts +1 -47
  111. package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
  112. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +22 -68
  113. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
  114. package/MarkerGauge/config.d.ts.map +1 -1
  115. package/MarkerGauge.config.js +75 -23
  116. package/MarkerGauge.config.js.map +2 -2
  117. package/MarkerGauge.js +560 -375
  118. package/MarkerGauge.js.map +4 -4
  119. package/NetworkGraph/NetworkGraph.d.ts +2 -5
  120. package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
  121. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
  122. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +1 -0
  123. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -1
  124. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +1 -0
  125. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
  126. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +1 -1
  127. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -1
  128. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +1 -0
  129. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
  130. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +23 -0
  131. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
  132. package/NetworkGraph.config.js +2 -0
  133. package/NetworkGraph.config.js.map +2 -2
  134. package/NetworkGraph.js +895 -455
  135. package/NetworkGraph.js.map +4 -4
  136. package/ParallelCoordinates.config.js.map +1 -1
  137. package/ParallelCoordinates.js +288 -172
  138. package/ParallelCoordinates.js.map +4 -4
  139. package/Pie/Pie.d.ts.map +1 -1
  140. package/Pie/pieUtils.d.ts +2 -2
  141. package/Pie.config.js +74 -22
  142. package/Pie.config.js.map +2 -2
  143. package/Pie.js +522 -296
  144. package/Pie.js.map +4 -4
  145. package/ProcessTree/ProcessTree.d.ts +23 -0
  146. package/ProcessTree/ProcessTree.d.ts.map +1 -0
  147. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +33 -0
  148. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -0
  149. package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts +8 -0
  150. package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts.map +1 -0
  151. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +46 -0
  152. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -0
  153. package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts +20 -0
  154. package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -0
  155. package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts +20 -0
  156. package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts.map +1 -0
  157. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +46 -0
  158. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -0
  159. package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts +23 -0
  160. package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts.map +1 -0
  161. package/ProcessTree/PureProcessTree/mockdata/data.d.ts +235 -0
  162. package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -0
  163. package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +9 -0
  164. package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -0
  165. package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts +36 -0
  166. package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts.map +1 -0
  167. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +82 -0
  168. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -0
  169. package/ProcessTree/config.d.ts +4 -0
  170. package/ProcessTree/config.d.ts.map +1 -0
  171. package/ProcessTree/index.d.ts +3 -0
  172. package/ProcessTree/index.d.ts.map +1 -0
  173. package/ProcessTree.config.js +192 -0
  174. package/ProcessTree.config.js.map +7 -0
  175. package/ProcessTree.js +5128 -0
  176. package/ProcessTree.js.map +7 -0
  177. package/Punchcard/Punchcard.d.ts +1 -5
  178. package/Punchcard/Punchcard.d.ts.map +1 -1
  179. package/Punchcard/PurePunchcard/Punchcard.d.ts +28 -32
  180. package/Punchcard/PurePunchcard/Punchcard.d.ts.map +1 -1
  181. package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts +7 -12
  182. package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts.map +1 -1
  183. package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts +14 -19
  184. package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts.map +1 -1
  185. package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts +22 -27
  186. package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts.map +1 -1
  187. package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts +3 -8
  188. package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts.map +1 -1
  189. package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts +9 -14
  190. package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts.map +1 -1
  191. package/Punchcard/PurePunchcard/src/PunchcardRow.d.ts.map +1 -1
  192. package/Punchcard.config.js.map +1 -1
  193. package/Punchcard.js +444 -631
  194. package/Punchcard.js.map +4 -4
  195. package/README.md +2 -0
  196. package/Rectangle.config.js +1 -1
  197. package/Rectangle.config.js.map +2 -2
  198. package/Rectangle.js +289 -173
  199. package/Rectangle.js.map +4 -4
  200. package/RichText/PureRichText/Editor/EditorPanel.d.ts +20 -0
  201. package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -0
  202. package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts +17 -0
  203. package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts.map +1 -0
  204. package/RichText/PureRichText/Editor/FontSelector.d.ts +15 -0
  205. package/RichText/PureRichText/Editor/FontSelector.d.ts.map +1 -0
  206. package/RichText/PureRichText/Editor/FormatButton.d.ts +23 -0
  207. package/RichText/PureRichText/Editor/FormatButton.d.ts.map +1 -0
  208. package/RichText/PureRichText/Editor/editorPanelUtils.d.ts +19 -0
  209. package/RichText/PureRichText/Editor/editorPanelUtils.d.ts.map +1 -0
  210. package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts +11 -0
  211. package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts.map +1 -0
  212. package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts +26 -0
  213. package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -0
  214. package/RichText/PureRichText/Editor/index.d.ts +9 -0
  215. package/RichText/PureRichText/Editor/index.d.ts.map +1 -0
  216. package/RichText/PureRichText/InnerEditor.d.ts +41 -0
  217. package/RichText/PureRichText/InnerEditor.d.ts.map +1 -0
  218. package/RichText/PureRichText/PureRichText.d.ts +19 -0
  219. package/RichText/PureRichText/PureRichText.d.ts.map +1 -0
  220. package/RichText/PureRichText/PureRichTextContext.d.ts +64 -0
  221. package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -0
  222. package/RichText/PureRichText/RichTextStyles.d.ts +25 -0
  223. package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -0
  224. package/RichText/PureRichText/activeInstance.d.ts +23 -0
  225. package/RichText/PureRichText/activeInstance.d.ts.map +1 -0
  226. package/RichText/PureRichText/config.d.ts +17 -0
  227. package/RichText/PureRichText/config.d.ts.map +1 -0
  228. package/RichText/PureRichText/hooks/index.d.ts +12 -0
  229. package/RichText/PureRichText/hooks/index.d.ts.map +1 -0
  230. package/RichText/PureRichText/hooks/useContentSave.d.ts +25 -0
  231. package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -0
  232. package/RichText/PureRichText/hooks/useContentSync.d.ts +28 -0
  233. package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -0
  234. package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts +33 -0
  235. package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -0
  236. package/RichText/PureRichText/hooks/useEditModeEffect.d.ts +10 -0
  237. package/RichText/PureRichText/hooks/useEditModeEffect.d.ts.map +1 -0
  238. package/RichText/PureRichText/hooks/useEditorSetup.d.ts +36 -0
  239. package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -0
  240. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +33 -0
  241. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -0
  242. package/RichText/PureRichText/hooks/useFocusHandlers.d.ts +35 -0
  243. package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -0
  244. package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts +18 -0
  245. package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  246. package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +24 -0
  247. package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -0
  248. package/RichText/PureRichText/hooks/useRichTextState.d.ts +38 -0
  249. package/RichText/PureRichText/hooks/useRichTextState.d.ts.map +1 -0
  250. package/RichText/PureRichText/hooks/useStepFontSize.d.ts +17 -0
  251. package/RichText/PureRichText/hooks/useStepFontSize.d.ts.map +1 -0
  252. package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +18 -0
  253. package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -0
  254. package/RichText/PureRichText/hooks/useTokenMap.d.ts +45 -0
  255. package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -0
  256. package/RichText/PureRichText/index.d.ts +16 -0
  257. package/RichText/PureRichText/index.d.ts.map +1 -0
  258. package/RichText/PureRichText/renderers/ElementRenderer.d.ts +8 -0
  259. package/RichText/PureRichText/renderers/ElementRenderer.d.ts.map +1 -0
  260. package/RichText/PureRichText/renderers/LeafRenderer.d.ts +8 -0
  261. package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -0
  262. package/RichText/PureRichText/types.d.ts +111 -0
  263. package/RichText/PureRichText/types.d.ts.map +1 -0
  264. package/RichText/PureRichText/utils/a11yUtils.d.ts +9 -0
  265. package/RichText/PureRichText/utils/a11yUtils.d.ts.map +1 -0
  266. package/RichText/PureRichText/utils/fontSize.d.ts +6 -0
  267. package/RichText/PureRichText/utils/fontSize.d.ts.map +1 -0
  268. package/RichText/PureRichText/utils/slateUtils.d.ts +99 -0
  269. package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -0
  270. package/RichText/RichText.d.ts +17 -0
  271. package/RichText/RichText.d.ts.map +1 -0
  272. package/RichText/config.d.ts +4 -0
  273. package/RichText/config.d.ts.map +1 -0
  274. package/RichText/index.d.ts +7 -0
  275. package/RichText/index.d.ts.map +1 -0
  276. package/RichText.config.js +268 -0
  277. package/RichText.config.js.map +7 -0
  278. package/RichText.js +7674 -0
  279. package/RichText.js.map +7 -0
  280. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  281. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  282. package/Sankey/PureSankey/SankeyNode.d.ts +10 -3
  283. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  284. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  285. package/Sankey/PureSankey/SankeyUtils.d.ts +10 -0
  286. package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
  287. package/Sankey.config.js.map +1 -1
  288. package/Sankey.js +562 -290
  289. package/Sankey.js.map +4 -4
  290. package/Scatter/Scatter.d.ts.map +1 -1
  291. package/Scatter.config.js +81 -24
  292. package/Scatter.config.js.map +3 -3
  293. package/Scatter.js +528 -297
  294. package/Scatter.js.map +4 -4
  295. package/SingleValue/SingleValue.d.ts.map +1 -1
  296. package/SingleValue/config.d.ts.map +1 -1
  297. package/SingleValue.config.js +76 -24
  298. package/SingleValue.config.js.map +2 -2
  299. package/SingleValue.js +896 -779
  300. package/SingleValue.js.map +4 -4
  301. package/SingleValueBasic.js.map +1 -1
  302. package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
  303. package/SingleValueIcon/config.d.ts.map +1 -1
  304. package/SingleValueIcon.config.js +76 -24
  305. package/SingleValueIcon.config.js.map +2 -2
  306. package/SingleValueIcon.js +512 -287
  307. package/SingleValueIcon.js.map +4 -4
  308. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
  309. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
  310. package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
  311. package/SingleValueRadial/config.d.ts.map +1 -1
  312. package/SingleValueRadial.config.js +76 -24
  313. package/SingleValueRadial.config.js.map +2 -2
  314. package/SingleValueRadial.js +543 -326
  315. package/SingleValueRadial.js.map +4 -4
  316. package/SparkLine/SparkLine.d.ts +57 -0
  317. package/SparkLine/SparkLine.d.ts.map +1 -0
  318. package/SparkLine/index.d.ts +1 -1
  319. package/SparkLine/index.d.ts.map +1 -1
  320. package/SparkLine.js +384 -485
  321. package/SparkLine.js.map +4 -4
  322. package/TRELLIS.md +48 -0
  323. package/Table/PureTable.d.ts +1 -0
  324. package/Table/PureTable.d.ts.map +1 -1
  325. package/Table/Table.d.ts.map +1 -1
  326. package/Table/cells/ArrayCell.d.ts.map +1 -1
  327. package/Table/config.d.ts.map +1 -1
  328. package/Table/hooks.d.ts +1 -1
  329. package/Table/hooks.d.ts.map +1 -1
  330. package/Table/tableUtils.d.ts +14 -0
  331. package/Table/tableUtils.d.ts.map +1 -0
  332. package/Table.config.js +4 -10
  333. package/Table.config.js.map +2 -2
  334. package/Table.js +1158 -846
  335. package/Table.js.map +4 -4
  336. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  337. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +5 -0
  338. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  339. package/Timeline/Timeline.d.ts +2 -0
  340. package/Timeline/Timeline.d.ts.map +1 -1
  341. package/Timeline/config.d.ts.map +1 -1
  342. package/Timeline/mockdata/timelineDataSource.d.ts +34 -0
  343. package/Timeline/mockdata/timelineDataSource.d.ts.map +1 -1
  344. package/Timeline.config.js +15 -0
  345. package/Timeline.config.js.map +2 -2
  346. package/Timeline.js +348 -186
  347. package/Timeline.js.map +4 -4
  348. package/common/Charting.d.ts.map +1 -1
  349. package/common/Charting.js +50 -28
  350. package/common/Charting.js.map +2 -2
  351. package/common/ChartingApi.d.ts +1 -1
  352. package/common/ChartingApi.d.ts.map +1 -1
  353. package/common/ChartingApi.js.map +2 -2
  354. package/common/DocExampleWithVizSandbox.js.map +1 -1
  355. package/common/OptionsDoc.js.map +1 -1
  356. package/common/OverviewDoc.js.map +1 -1
  357. package/common/SplunkVisualization.d.ts +1 -1
  358. package/common/SplunkVisualization.d.ts.map +1 -1
  359. package/common/SplunkVisualization.js +6 -4
  360. package/common/SplunkVisualization.js.map +2 -2
  361. package/common/StyledSkipLink.d.ts +2 -0
  362. package/common/StyledSkipLink.d.ts.map +1 -0
  363. package/common/StyledSkipLink.js +81 -0
  364. package/common/StyledSkipLink.js.map +7 -0
  365. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  366. package/common/TimeSeriesChartWrapper.js +228 -107
  367. package/common/TimeSeriesChartWrapper.js.map +4 -4
  368. package/common/chartingUtils.d.ts +32 -6
  369. package/common/chartingUtils.d.ts.map +1 -1
  370. package/common/chartingUtils.js +166 -39
  371. package/common/chartingUtils.js.map +4 -4
  372. package/common/components/TrellisTitle.d.ts.map +1 -1
  373. package/common/docUtils.js +1 -1
  374. package/common/docUtils.js.map +2 -2
  375. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  376. package/common/editorConfig/AxesChartYGridAndLabels.d.ts.map +1 -1
  377. package/common/editorConfig/BackgroundColor.d.ts +2 -2
  378. package/common/editorConfig/TrellisEditors.d.ts +33 -5
  379. package/common/editorConfig/TrellisEditors.d.ts.map +1 -1
  380. package/common/hocs/mockdata/trellisData.d.ts +54 -0
  381. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  382. package/common/hocs/withTrellis.d.ts +9 -0
  383. package/common/hocs/withTrellis.d.ts.map +1 -1
  384. package/common/hooks/useSorting.d.ts +2 -2
  385. package/common/hooks/useSorting.d.ts.map +1 -1
  386. package/common/shapeUtils.d.ts +1 -1
  387. package/common/shapeUtils.d.ts.map +1 -1
  388. package/common/shapeUtils.js.map +2 -2
  389. package/common/utils/dataUtils.js +2 -1
  390. package/common/utils/dataUtils.js.map +2 -2
  391. package/common/utils/focusUtils.d.ts +4 -0
  392. package/common/utils/focusUtils.d.ts.map +1 -0
  393. package/common/utils/focusUtils.js +101 -0
  394. package/common/utils/focusUtils.js.map +7 -0
  395. package/common/utils/mapUtils.js +513 -184
  396. package/common/utils/mapUtils.js.map +4 -4
  397. package/common/utils/shadowDomUtils.d.ts +2 -0
  398. package/common/utils/shadowDomUtils.d.ts.map +1 -0
  399. package/common/utils/shadowDomUtils.js +39 -0
  400. package/common/utils/shadowDomUtils.js.map +7 -0
  401. package/common/utils/singleValueUtils.js +14 -26
  402. package/common/utils/singleValueUtils.js.map +2 -2
  403. package/common/utils/trellisUtils.d.ts.map +1 -1
  404. package/common/utils/trellisUtils.js +76 -70
  405. package/common/utils/trellisUtils.js.map +2 -2
  406. package/common/withDashboardViz.d.ts.map +1 -1
  407. package/common/withDashboardViz.js +276 -151
  408. package/common/withDashboardViz.js.map +4 -4
  409. package/docs-llm/INDEX.md +118 -0
  410. package/docs-llm/area/examples-json.md +3854 -0
  411. package/docs-llm/area/examples-react.md +2816 -0
  412. package/docs-llm/area/options.md +97 -0
  413. package/docs-llm/area/overview.md +27 -0
  414. package/docs-llm/bar/examples-json.md +3380 -0
  415. package/docs-llm/bar/examples-react.md +2352 -0
  416. package/docs-llm/bar/options.md +89 -0
  417. package/docs-llm/bar/overview.md +25 -0
  418. package/docs-llm/bubble/examples-json.md +4082 -0
  419. package/docs-llm/bubble/examples-react.md +3977 -0
  420. package/docs-llm/bubble/options.md +62 -0
  421. package/docs-llm/bubble/overview.md +26 -0
  422. package/docs-llm/choropleth-svg/examples-json.md +397 -0
  423. package/docs-llm/choropleth-svg/examples-react.md +389 -0
  424. package/docs-llm/choropleth-svg/options.md +15 -0
  425. package/docs-llm/choropleth-svg/overview.md +23 -0
  426. package/docs-llm/column/examples-json.md +3898 -0
  427. package/docs-llm/column/examples-react.md +2653 -0
  428. package/docs-llm/column/options.md +94 -0
  429. package/docs-llm/column/overview.md +31 -0
  430. package/docs-llm/dsl/examples-json.md +43 -0
  431. package/docs-llm/dsl/examples-react.md +78 -0
  432. package/docs-llm/dsl/formatters/format-by-type-examples-json.md +58 -0
  433. package/docs-llm/dsl/formatters/format-by-type-examples-react.md +43 -0
  434. package/docs-llm/dsl/formatters/format-by-type.md +38 -0
  435. package/docs-llm/dsl/formatters/frame-examples-json.md +42 -0
  436. package/docs-llm/dsl/formatters/frame-examples-react.md +24 -0
  437. package/docs-llm/dsl/formatters/frame.md +6 -0
  438. package/docs-llm/dsl/formatters/gradient-examples-json.md +98 -0
  439. package/docs-llm/dsl/formatters/gradient-examples-react.md +44 -0
  440. package/docs-llm/dsl/formatters/gradient.md +23 -0
  441. package/docs-llm/dsl/formatters/lerp-examples-json.md +40 -0
  442. package/docs-llm/dsl/formatters/lerp-examples-react.md +28 -0
  443. package/docs-llm/dsl/formatters/lerp.md +19 -0
  444. package/docs-llm/dsl/formatters/match-value-examples-json.md +65 -0
  445. package/docs-llm/dsl/formatters/match-value-examples-react.md +37 -0
  446. package/docs-llm/dsl/formatters/match-value.md +13 -0
  447. package/docs-llm/dsl/formatters/max-contrast-examples-json.md +39 -0
  448. package/docs-llm/dsl/formatters/max-contrast-examples-react.md +27 -0
  449. package/docs-llm/dsl/formatters/max-contrast.md +9 -0
  450. package/docs-llm/dsl/formatters/multi-format-examples-json.md +67 -0
  451. package/docs-llm/dsl/formatters/multi-format-examples-react.md +49 -0
  452. package/docs-llm/dsl/formatters/multi-format.md +12 -0
  453. package/docs-llm/dsl/formatters/objects-examples-json.md +49 -0
  454. package/docs-llm/dsl/formatters/objects-examples-react.md +37 -0
  455. package/docs-llm/dsl/formatters/objects.md +3 -0
  456. package/docs-llm/dsl/formatters/pick-examples-json.md +59 -0
  457. package/docs-llm/dsl/formatters/pick-examples-react.md +30 -0
  458. package/docs-llm/dsl/formatters/pick.md +9 -0
  459. package/docs-llm/dsl/formatters/prefix-examples-json.md +29 -0
  460. package/docs-llm/dsl/formatters/prefix-examples-react.md +19 -0
  461. package/docs-llm/dsl/formatters/prefix.md +3 -0
  462. package/docs-llm/dsl/formatters/prepend-examples-json.md +51 -0
  463. package/docs-llm/dsl/formatters/prepend-examples-react.md +33 -0
  464. package/docs-llm/dsl/formatters/prepend.md +9 -0
  465. package/docs-llm/dsl/formatters/range-value-examples-json.md +48 -0
  466. package/docs-llm/dsl/formatters/range-value-examples-react.md +34 -0
  467. package/docs-llm/dsl/formatters/range-value.md +15 -0
  468. package/docs-llm/dsl/formatters/set-color-channel-examples-json.md +40 -0
  469. package/docs-llm/dsl/formatters/set-color-channel-examples-react.md +31 -0
  470. package/docs-llm/dsl/formatters/set-color-channel.md +9 -0
  471. package/docs-llm/dsl/formatters/suffix-examples-json.md +29 -0
  472. package/docs-llm/dsl/formatters/suffix-examples-react.md +19 -0
  473. package/docs-llm/dsl/formatters/suffix.md +3 -0
  474. package/docs-llm/dsl/formatters/type-examples-json.md +37 -0
  475. package/docs-llm/dsl/formatters/type-examples-react.md +20 -0
  476. package/docs-llm/dsl/formatters/type.md +3 -0
  477. package/docs-llm/dsl/overview.md +41 -0
  478. package/docs-llm/dsl/selectors/abs.md +7 -0
  479. package/docs-llm/dsl/selectors/ceil.md +7 -0
  480. package/docs-llm/dsl/selectors/data-frame-average-examples-json.md +41 -0
  481. package/docs-llm/dsl/selectors/data-frame-average-examples-react.md +36 -0
  482. package/docs-llm/dsl/selectors/data-frame-average.md +7 -0
  483. package/docs-llm/dsl/selectors/data-frame-count-examples-json.md +41 -0
  484. package/docs-llm/dsl/selectors/data-frame-count-examples-react.md +36 -0
  485. package/docs-llm/dsl/selectors/data-frame-count.md +7 -0
  486. package/docs-llm/dsl/selectors/data-frame-examples-json.md +830 -0
  487. package/docs-llm/dsl/selectors/data-frame-examples-react.md +929 -0
  488. package/docs-llm/dsl/selectors/data-frame-get-field-examples-json.md +89 -0
  489. package/docs-llm/dsl/selectors/data-frame-get-field-examples-react.md +124 -0
  490. package/docs-llm/dsl/selectors/data-frame-get-field.md +5 -0
  491. package/docs-llm/dsl/selectors/data-frame-get-raw-value.md +5 -0
  492. package/docs-llm/dsl/selectors/data-frame-get-type.md +5 -0
  493. package/docs-llm/dsl/selectors/data-frame-get-value.md +5 -0
  494. package/docs-llm/dsl/selectors/data-frame-max-examples-json.md +51 -0
  495. package/docs-llm/dsl/selectors/data-frame-max-examples-react.md +41 -0
  496. package/docs-llm/dsl/selectors/data-frame-max.md +7 -0
  497. package/docs-llm/dsl/selectors/data-frame-min-examples-json.md +51 -0
  498. package/docs-llm/dsl/selectors/data-frame-min-examples-react.md +41 -0
  499. package/docs-llm/dsl/selectors/data-frame-min.md +7 -0
  500. package/docs-llm/dsl/selectors/data-frame-percentile-examples-json.md +41 -0
  501. package/docs-llm/dsl/selectors/data-frame-percentile-examples-react.md +36 -0
  502. package/docs-llm/dsl/selectors/data-frame-percentile.md +8 -0
  503. package/docs-llm/dsl/selectors/data-frame-set-value.md +5 -0
  504. package/docs-llm/dsl/selectors/data-frame-sum-examples-json.md +51 -0
  505. package/docs-llm/dsl/selectors/data-frame-sum-examples-react.md +41 -0
  506. package/docs-llm/dsl/selectors/data-frame-sum.md +7 -0
  507. package/docs-llm/dsl/selectors/data-frame.md +4 -0
  508. package/docs-llm/dsl/selectors/data-point-get-field.md +5 -0
  509. package/docs-llm/dsl/selectors/data-point-get-raw-value.md +4 -0
  510. package/docs-llm/dsl/selectors/data-point-get-type.md +5 -0
  511. package/docs-llm/dsl/selectors/data-point-get-value.md +5 -0
  512. package/docs-llm/dsl/selectors/data-point-set-value.md +4 -0
  513. package/docs-llm/dsl/selectors/data-point.md +5 -0
  514. package/docs-llm/dsl/selectors/data-series-average.md +22 -0
  515. package/docs-llm/dsl/selectors/data-series-count.md +14 -0
  516. package/docs-llm/dsl/selectors/data-series-get-field.md +5 -0
  517. package/docs-llm/dsl/selectors/data-series-get-raw-value.md +4 -0
  518. package/docs-llm/dsl/selectors/data-series-get-type.md +5 -0
  519. package/docs-llm/dsl/selectors/data-series-get-value.md +4 -0
  520. package/docs-llm/dsl/selectors/data-series-max.md +5 -0
  521. package/docs-llm/dsl/selectors/data-series-min.md +5 -0
  522. package/docs-llm/dsl/selectors/data-series-percentile.md +17 -0
  523. package/docs-llm/dsl/selectors/data-series-set-value.md +4 -0
  524. package/docs-llm/dsl/selectors/data-series-sum.md +24 -0
  525. package/docs-llm/dsl/selectors/data-series.md +4 -0
  526. package/docs-llm/dsl/selectors/delta.md +7 -0
  527. package/docs-llm/dsl/selectors/divide.md +8 -0
  528. package/docs-llm/dsl/selectors/first-point.md +5 -0
  529. package/docs-llm/dsl/selectors/floor.md +7 -0
  530. package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-json.md +89 -0
  531. package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-react.md +88 -0
  532. package/docs-llm/dsl/selectors/frame-by-series-index-range.md +10 -0
  533. package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-json.md +88 -0
  534. package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-react.md +87 -0
  535. package/docs-llm/dsl/selectors/frame-by-series-indexes.md +9 -0
  536. package/docs-llm/dsl/selectors/frame-by-series-names-examples-json.md +89 -0
  537. package/docs-llm/dsl/selectors/frame-by-series-names-examples-react.md +88 -0
  538. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-json.md +89 -0
  539. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-react.md +88 -0
  540. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes.md +9 -0
  541. package/docs-llm/dsl/selectors/frame-by-series-names.md +9 -0
  542. package/docs-llm/dsl/selectors/frame-by-series-types-examples-json.md +89 -0
  543. package/docs-llm/dsl/selectors/frame-by-series-types-examples-react.md +88 -0
  544. package/docs-llm/dsl/selectors/frame-by-series-types.md +9 -0
  545. package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-json.md +137 -0
  546. package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-react.md +135 -0
  547. package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-json.md +157 -0
  548. package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-react.md +155 -0
  549. package/docs-llm/dsl/selectors/frame-without-internal-fields-except.md +21 -0
  550. package/docs-llm/dsl/selectors/frame-without-internal-fields.md +17 -0
  551. package/docs-llm/dsl/selectors/frame-without-series-names.md +8 -0
  552. package/docs-llm/dsl/selectors/last-point.md +5 -0
  553. package/docs-llm/dsl/selectors/minus.md +8 -0
  554. package/docs-llm/dsl/selectors/multiply.md +8 -0
  555. package/docs-llm/dsl/selectors/plus.md +8 -0
  556. package/docs-llm/dsl/selectors/point-by-index.md +6 -0
  557. package/docs-llm/dsl/selectors/points-by-indexes.md +6 -0
  558. package/docs-llm/dsl/selectors/round.md +7 -0
  559. package/docs-llm/dsl/selectors/series-by-index-examples-json.md +49 -0
  560. package/docs-llm/dsl/selectors/series-by-index-examples-react.md +39 -0
  561. package/docs-llm/dsl/selectors/series-by-index.md +8 -0
  562. package/docs-llm/dsl/selectors/series-by-name-examples-json.md +49 -0
  563. package/docs-llm/dsl/selectors/series-by-name-examples-react.md +39 -0
  564. package/docs-llm/dsl/selectors/series-by-name.md +8 -0
  565. package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-json.md +47 -0
  566. package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-react.md +39 -0
  567. package/docs-llm/dsl/selectors/series-by-prioritized-types.md +10 -0
  568. package/docs-llm/dsl/selectors/series-by-type-examples-json.md +49 -0
  569. package/docs-llm/dsl/selectors/series-by-type-examples-react.md +39 -0
  570. package/docs-llm/dsl/selectors/series-by-type.md +10 -0
  571. package/docs-llm/dsl/selectors/series-by-types.md +6 -0
  572. package/docs-llm/ellipse/examples-json.md +5 -0
  573. package/docs-llm/ellipse/examples-react.md +5 -0
  574. package/docs-llm/ellipse/options.md +16 -0
  575. package/docs-llm/ellipse/overview.md +5 -0
  576. package/docs-llm/events/examples-json.md +705 -0
  577. package/docs-llm/events/examples-react.md +536 -0
  578. package/docs-llm/events/options.md +18 -0
  579. package/docs-llm/events/overview.md +5 -0
  580. package/docs-llm/filler-gauge/examples-json.md +376 -0
  581. package/docs-llm/filler-gauge/examples-react.md +274 -0
  582. package/docs-llm/filler-gauge/options.md +26 -0
  583. package/docs-llm/filler-gauge/overview.md +5 -0
  584. package/docs-llm/image/examples-json.md +39 -0
  585. package/docs-llm/image/examples-react.md +65 -0
  586. package/docs-llm/image/options.md +13 -0
  587. package/docs-llm/image/overview.md +5 -0
  588. package/docs-llm/line/examples-json.md +3724 -0
  589. package/docs-llm/line/examples-react.md +2683 -0
  590. package/docs-llm/line/options.md +95 -0
  591. package/docs-llm/line/overview.md +29 -0
  592. package/docs-llm/link-graph/examples-json.md +5 -0
  593. package/docs-llm/link-graph/examples-react.md +5 -0
  594. package/docs-llm/link-graph/options.md +26 -0
  595. package/docs-llm/link-graph/overview.md +16 -0
  596. package/docs-llm/map/examples-json.md +13973 -0
  597. package/docs-llm/map/examples-react.md +6154 -0
  598. package/docs-llm/map/options.md +22 -0
  599. package/docs-llm/map/overview.md +32 -0
  600. package/docs-llm/markdown/examples-json.md +63 -0
  601. package/docs-llm/markdown/examples-react.md +98 -0
  602. package/docs-llm/markdown/options.md +17 -0
  603. package/docs-llm/markdown/overview.md +5 -0
  604. package/docs-llm/marker-gauge/examples-json.md +436 -0
  605. package/docs-llm/marker-gauge/examples-react.md +367 -0
  606. package/docs-llm/marker-gauge/options.md +26 -0
  607. package/docs-llm/marker-gauge/overview.md +5 -0
  608. package/docs-llm/network-graph/examples-json.md +8843 -0
  609. package/docs-llm/network-graph/examples-react.md +7339 -0
  610. package/docs-llm/network-graph/options.md +50 -0
  611. package/docs-llm/network-graph/overview.md +28 -0
  612. package/docs-llm/parallel-coordinates/examples-json.md +8376 -0
  613. package/docs-llm/parallel-coordinates/examples-react.md +2771 -0
  614. package/docs-llm/parallel-coordinates/options.md +14 -0
  615. package/docs-llm/parallel-coordinates/overview.md +22 -0
  616. package/docs-llm/pie/examples-json.md +851 -0
  617. package/docs-llm/pie/examples-react.md +606 -0
  618. package/docs-llm/pie/options.md +34 -0
  619. package/docs-llm/pie/overview.md +23 -0
  620. package/docs-llm/process-tree/options.md +32 -0
  621. package/docs-llm/punchcard/examples-json.md +6134 -0
  622. package/docs-llm/punchcard/examples-react.md +4562 -0
  623. package/docs-llm/punchcard/options.md +33 -0
  624. package/docs-llm/punchcard/overview.md +5 -0
  625. package/docs-llm/pure-rich-text/options.md +28 -0
  626. package/docs-llm/rectangle/examples-json.md +5 -0
  627. package/docs-llm/rectangle/examples-react.md +5 -0
  628. package/docs-llm/rectangle/options.md +19 -0
  629. package/docs-llm/rectangle/overview.md +5 -0
  630. package/docs-llm/rich-text/examples-json.md +96 -0
  631. package/docs-llm/rich-text/examples-react.md +119 -0
  632. package/docs-llm/rich-text/options.md +28 -0
  633. package/docs-llm/rich-text/overview.md +5 -0
  634. package/docs-llm/sankey/examples-json.md +844 -0
  635. package/docs-llm/sankey/examples-react.md +546 -0
  636. package/docs-llm/sankey/options.md +19 -0
  637. package/docs-llm/sankey/overview.md +24 -0
  638. package/docs-llm/scatter/examples-json.md +4012 -0
  639. package/docs-llm/scatter/examples-react.md +3914 -0
  640. package/docs-llm/scatter/options.md +68 -0
  641. package/docs-llm/scatter/overview.md +25 -0
  642. package/docs-llm/single-value/examples-json.md +2613 -0
  643. package/docs-llm/single-value/examples-react.md +2296 -0
  644. package/docs-llm/single-value/options.md +49 -0
  645. package/docs-llm/single-value/overview.md +23 -0
  646. package/docs-llm/single-value-icon/examples-json.md +1686 -0
  647. package/docs-llm/single-value-icon/examples-react.md +1573 -0
  648. package/docs-llm/single-value-icon/options.md +43 -0
  649. package/docs-llm/single-value-icon/overview.md +5 -0
  650. package/docs-llm/single-value-radial/examples-json.md +1178 -0
  651. package/docs-llm/single-value-radial/examples-react.md +1028 -0
  652. package/docs-llm/single-value-radial/options.md +41 -0
  653. package/docs-llm/single-value-radial/overview.md +5 -0
  654. package/docs-llm/table/examples-json.md +5 -0
  655. package/docs-llm/table/examples-react.md +5 -0
  656. package/docs-llm/table/options.md +25 -0
  657. package/docs-llm/table/overview.md +24 -0
  658. package/docs-llm/timeline/examples-json.md +5 -0
  659. package/docs-llm/timeline/examples-react.md +5 -0
  660. package/docs-llm/timeline/options.md +27 -0
  661. package/docs-llm/timeline/overview.md +24 -0
  662. package/package.json +39 -30
  663. package/LICENSE.md +0 -449
package/Table.js CHANGED
@@ -12,6 +12,7 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
12
12
  var __getProtoOf = Object.getPrototypeOf;
13
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
14
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
15
+ var __pow = Math.pow;
15
16
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
17
  var __spreadValues = (a, b) => {
17
18
  for (var prop in b || (b = {}))
@@ -415,18 +416,12 @@ var themes = {
415
416
  prisma: variables_default.backgroundColor(props)
416
417
  })(props),
417
418
  rowBackgroundColorEven: (props) => pick_default({
418
- enterprise: {
419
- dark: variables_default.black(props),
420
- light: variables_default.gray96(props)
421
- },
422
- prisma: variables_default.backgroundColorPage(props)
419
+ enterprise: { dark: "rgba(35,36,41,0.4)", light: "rgba(240,240,240,0.6)" },
420
+ prisma: { dark: "rgba(35,36,41,0.4)", light: "rgba(240,240,240,0.6)" }
423
421
  })(props),
424
422
  rowBackgroundColorOdd: (props) => pick_default({
425
- enterprise: {
426
- dark: "#0D1012",
427
- light: variables_default.backgroundColor(props)
428
- },
429
- prisma: { dark: variables_default.backgroundColorSidebar(props), light: variables_default.white(props) }
423
+ enterprise: { dark: "rgba(0,0,0,0.4)", light: "rgba(255,255,255,0.6)" },
424
+ prisma: { dark: "rgba(0,0,0,0.4)", light: "rgba(255,255,255,0.6)" }
430
425
  })(props),
431
426
  textColor: (props) => pick_default({
432
427
  enterprise: variables_default.textColor(props),
@@ -942,7 +937,7 @@ var DefaultVizActionHandler = class {
942
937
  var INITIAL_HEIGHT = 250;
943
938
  var SplunkVisualization = class {
944
939
  };
945
- SplunkVisualization.propTypes = {
940
+ __publicField(SplunkVisualization, "propTypes", {
946
941
  /**
947
942
  * display mode
948
943
  */
@@ -1018,11 +1013,11 @@ SplunkVisualization.propTypes = {
1018
1013
  * A callback to request new data with updated request params
1019
1014
  */
1020
1015
  onRequestParamsChange: prop_types_exports.func
1021
- };
1016
+ });
1022
1017
  /**
1023
1018
  *
1024
1019
  */
1025
- SplunkVisualization.defaults = {
1020
+ __publicField(SplunkVisualization, "defaults", {
1026
1021
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1027
1022
  width: "100%",
1028
1023
  height: INITIAL_HEIGHT,
@@ -1037,7 +1032,7 @@ SplunkVisualization.defaults = {
1037
1032
  onComputedProps: () => ({}),
1038
1033
  loading: false,
1039
1034
  onRequestParamsChange: lodash_exports.noop
1040
- };
1035
+ });
1041
1036
  var SplunkVisualization_default = SplunkVisualization;
1042
1037
 
1043
1038
  // src/common/interfaces/DataSource.ts
@@ -1091,9 +1086,9 @@ var usePaginationParams = ({
1091
1086
  meta,
1092
1087
  onRequestParamsChange
1093
1088
  }) => {
1094
- const totalCount = meta && meta.totalCount || 0;
1095
- const offset = requestParams && requestParams.offset || 0;
1096
- const count = requestParams && requestParams.count;
1089
+ const totalCount = (meta == null ? void 0 : meta.totalCount) || 0;
1090
+ const offset = (requestParams == null ? void 0 : requestParams.offset) || 0;
1091
+ const count = requestParams == null ? void 0 : requestParams.count;
1097
1092
  const totalPages = typeof count === "number" && count > 0 ? Math.ceil(totalCount / count) : 0;
1098
1093
  const current = typeof count === "number" && count > 0 ? Math.floor(offset / count) + 1 : 0;
1099
1094
  const isPaging = totalPages > 1 && typeof onRequestParamsChange === "function";
@@ -1152,7 +1147,7 @@ var SizeAwareWrapper_default = "default" in defaultImport29 ? defaultImport29.de
1152
1147
  var isMissing = (v) => {
1153
1148
  return v === null || v === void 0;
1154
1149
  };
1155
- var missingKeys = (keys2, target) => keys2.filter((k) => isMissing(target[k]));
1150
+ var missingKeys = (keys, target) => keys.filter((k) => isMissing(target[k]));
1156
1151
  var MissingPropsMessage = (props) => {
1157
1152
  const {
1158
1153
  width = SplunkVisualization_default.defaults.width,
@@ -1201,7 +1196,7 @@ var Cover = styled_components_default.div`
1201
1196
  bottom: 0;
1202
1197
  `;
1203
1198
  var Blocker = styled_components_default.div.attrs({
1204
- "data-splunk-visualization-version": "28.5.3 - 657435b86"
1199
+ "data-splunk-visualization-version": "28.7.0 - d7b18cab6"
1205
1200
  })`
1206
1201
  position: relative;
1207
1202
  width: 100%;
@@ -1282,7 +1277,7 @@ var withFixedSizeContainer = (Viz) => {
1282
1277
  FixSizeItem,
1283
1278
  {
1284
1279
  "data-test": "fix-size-item",
1285
- "data-splunk-visualization-version": "28.5.3 - 657435b86",
1280
+ "data-splunk-visualization-version": "28.7.0 - d7b18cab6",
1286
1281
  width,
1287
1282
  height,
1288
1283
  backgroundColor
@@ -1823,6 +1818,24 @@ var defaultImport35 = __toESM(require("@splunk/react-icons/Triangle"));
1823
1818
  __reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
1824
1819
  var Triangle_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
1825
1820
 
1821
+ // esm-externals:@splunk/visualizations-shared/propUtils
1822
+ var propUtils_exports = {};
1823
+ __export(propUtils_exports, {
1824
+ default: () => propUtils_default
1825
+ });
1826
+ var defaultImport36 = __toESM(require("@splunk/visualizations-shared/propUtils"));
1827
+ __reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
1828
+ var propUtils_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
1829
+
1830
+ // esm-externals:@splunk/visualizations-shared/simpleXMLOptions
1831
+ var simpleXMLOptions_exports = {};
1832
+ __export(simpleXMLOptions_exports, {
1833
+ default: () => simpleXMLOptions_default
1834
+ });
1835
+ var defaultImport37 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
1836
+ __reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
1837
+ var simpleXMLOptions_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
1838
+
1826
1839
  // src/common/chartingUtils.ts
1827
1840
  var DEFAULT_LINE_WIDTH = 2;
1828
1841
  var getAnnotationsForCanvas = ({
@@ -1860,9 +1873,9 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1860
1873
  const xAxisIsTime = xField === "_time";
1861
1874
  return !!rangeSelectEventHandler && xAxisIsTime;
1862
1875
  };
1863
- var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1876
+ var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
1864
1877
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1865
- return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
1878
+ return canvasSupportedTimeSeriesCharts.includes(vizConfigKey);
1866
1879
  };
1867
1880
  var filterChartDataFromInternalFields = (chartData) => {
1868
1881
  const { fields, columns } = chartData;
@@ -2017,46 +2030,66 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
2017
2030
  }
2018
2031
  return y2Config;
2019
2032
  };
2020
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
2033
+ var getSeriesType = (isOverlay, isAreaChart, isStacked) => {
2034
+ if (isOverlay) return "line";
2035
+ if (!isAreaChart) return void 0;
2036
+ return isStacked ? "stacked-area" : "area";
2037
+ };
2038
+ var getY2Scale = (field, y2fields, overlayFields) => {
2039
+ const assignToY2 = (y2fields == null ? void 0 : y2fields.length) > 0 && y2fields.includes(field) || !(y2fields == null ? void 0 : y2fields.length) && (overlayFields == null ? void 0 : overlayFields.includes(field));
2040
+ return assignToY2 ? "y2" : "y";
2041
+ };
2042
+ var getSeriesOverrides = (opts) => {
2043
+ var _a;
2044
+ const {
2045
+ yfields,
2046
+ y2fields,
2047
+ lineWidth,
2048
+ overlayFields,
2049
+ y2Enabled,
2050
+ nullValueMode,
2051
+ markerDisplay,
2052
+ lineDashStyle,
2053
+ lineDashStylesByField,
2054
+ stepPosition,
2055
+ stepPositionsByField,
2056
+ type,
2057
+ stackMode,
2058
+ showLines
2059
+ } = opts;
2021
2060
  const seriesConfig = {};
2022
2061
  let spanGaps;
2023
- let replaceNullsWithZero;
2024
2062
  if (nullValueMode === "gaps") {
2025
2063
  spanGaps = false;
2026
- } else if (nullValueMode === "connect" || nullValueMode === "zero") {
2064
+ } else if (nullValueMode != null) {
2027
2065
  spanGaps = true;
2028
- if (nullValueMode === "zero") {
2029
- replaceNullsWithZero = true;
2030
- }
2066
+ } else {
2067
+ spanGaps = void 0;
2031
2068
  }
2032
- yfields.forEach((field) => {
2069
+ const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
2070
+ const isAreaChart = type === "area";
2071
+ const isStacked = isAreaChart && (stackMode === "stacked" || stackMode === "stacked100");
2072
+ const areaFields = isAreaChart ? yfields.filter((f) => !(overlayFields == null ? void 0 : overlayFields.includes(f))) : yfields;
2073
+ const overlayFieldsInOrder = (_a = overlayFields == null ? void 0 : overlayFields.filter((f) => yfields.includes(f))) != null ? _a : [];
2074
+ const orderedFields = isAreaChart ? [...areaFields, ...overlayFieldsInOrder] : yfields;
2075
+ orderedFields.forEach((field) => {
2076
+ var _a2;
2077
+ const isOverlay = (_a2 = overlayFields == null ? void 0 : overlayFields.includes(field)) != null ? _a2 : false;
2078
+ const isPercent = isAreaChart && stackMode === "stacked100" && !isOverlay;
2079
+ const shouldHideAreaOutline = isAreaChart && showLines === false && !isOverlay;
2033
2080
  seriesConfig[field] = {
2034
- overrides: { width: lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH }
2081
+ overrides: __spreadValues({
2082
+ width: shouldHideAreaOutline ? 0 : lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH
2083
+ }, isPercent ? { stacking: { mode: "percent", group: "A" } } : {})
2035
2084
  };
2036
- if (spanGaps !== void 0) {
2037
- seriesConfig[field].overrides.spanGaps = spanGaps;
2038
- }
2039
- if (y2Enabled) {
2040
- const shouldAssignToY2 = (
2041
- // If y2Fields are present, assign all y2Fields to y2 scale
2042
- (y2fields == null ? void 0 : y2fields.length) > 0 && y2fields.includes(field) || // Else, assign all overlayFields to y2 scale
2043
- (!y2fields || y2fields.length === 0) && (overlayFields == null ? void 0 : overlayFields.includes(field))
2044
- );
2045
- if (shouldAssignToY2) {
2046
- seriesConfig[field].overrides.scale = "y2";
2047
- } else {
2048
- seriesConfig[field].overrides.scale = "y";
2049
- }
2050
- }
2051
- if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
2052
- seriesConfig[field].type = "line";
2053
- }
2054
- if (markerDisplay !== void 0) {
2055
- seriesConfig[field].markerDisplay = markerDisplay;
2056
- }
2057
- const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2058
- if (fieldDashStyle) {
2059
- seriesConfig[field].lineDashStyle = fieldDashStyle;
2085
+ const seriesType = getSeriesType(isOverlay, isAreaChart, isStacked);
2086
+ if (seriesType !== void 0) seriesConfig[field].type = seriesType;
2087
+ if (spanGaps !== void 0) seriesConfig[field].overrides.spanGaps = spanGaps;
2088
+ if (y2Enabled) seriesConfig[field].overrides.scale = getY2Scale(field, y2fields, overlayFields);
2089
+ if (markerDisplay !== void 0) seriesConfig[field].markerDisplay = markerDisplay;
2090
+ if (!isAreaChart || isOverlay) {
2091
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2092
+ if (fieldDashStyle) seriesConfig[field].lineDashStyle = fieldDashStyle;
2060
2093
  }
2061
2094
  const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
2062
2095
  const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
@@ -2127,8 +2160,27 @@ var TrellisTitleDiv = styled_components_default.div`
2127
2160
  background-color: ${(props) => props.backgroundColor};
2128
2161
  box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
2129
2162
  `;
2163
+ var formatTrellisKey = (value) => {
2164
+ if (value === null || value === void 0) {
2165
+ return "";
2166
+ }
2167
+ if (typeof value === "string") {
2168
+ return value;
2169
+ }
2170
+ if (typeof value === "number" || typeof value === "boolean") {
2171
+ return value.toString();
2172
+ }
2173
+ if (typeof value === "symbol") {
2174
+ return value.toString();
2175
+ }
2176
+ try {
2177
+ return JSON.stringify(value);
2178
+ } catch (e) {
2179
+ return typeof value === "bigint" ? value.toString() : "";
2180
+ }
2181
+ };
2130
2182
  var TrellisTitle = (props) => {
2131
- const titleText = String(props.trellisKey).toString();
2183
+ const titleText = formatTrellisKey(props.trellisKey);
2132
2184
  return /* @__PURE__ */ react_exports.createElement(
2133
2185
  TrellisTitleDiv,
2134
2186
  {
@@ -2264,6 +2316,38 @@ var parseArrayOption = (value) => {
2264
2316
  }
2265
2317
  return void 0;
2266
2318
  };
2319
+ var getAreaOpacityForCanvas = (areaOpacity) => (
2320
+ // Preserve legacy visualizations behavior where area opacity is squared to match charting output.
2321
+ areaOpacity !== void 0 && areaOpacity !== null ? __pow(areaOpacity, 2) : areaOpacity
2322
+ );
2323
+ var parseTickIntervalOption = (simpleXMLValue, canvasValue) => {
2324
+ if (simpleXMLValue) return Number(simpleXMLValue);
2325
+ if (canvasValue) return Number(canvasValue);
2326
+ return void 0;
2327
+ };
2328
+ var getYAxisTitles = ({
2329
+ y2Enabled,
2330
+ yFields,
2331
+ y2Fields,
2332
+ overlayFields,
2333
+ yAxisTitleText,
2334
+ yAxisTitleVisibility,
2335
+ y2AxisTitleText,
2336
+ y2AxisTitleVisibility,
2337
+ containerHeight
2338
+ }) => {
2339
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2340
+ const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
2341
+ const yAxisTitle = ellipsisAxisTitle(
2342
+ getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility),
2343
+ containerHeight
2344
+ );
2345
+ const y2AxisTitle = ellipsisAxisTitle(
2346
+ getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility),
2347
+ containerHeight
2348
+ );
2349
+ return { yAxisTitle, y2AxisTitle };
2350
+ };
2267
2351
  var TimeSeriesChartWrapper = (props) => {
2268
2352
  var _b, _c, _d;
2269
2353
  const _a = props, {
@@ -2353,6 +2437,8 @@ var TimeSeriesChartWrapper = (props) => {
2353
2437
  "chart.overlayFields": overlayFieldsStr,
2354
2438
  "chart.nullValueMode": nullValueMode,
2355
2439
  "chart.showDataLabels": showDataLabels,
2440
+ "chart.showLines": showLines,
2441
+ "chart.stackMode": stackMode,
2356
2442
  lineWidth,
2357
2443
  lineDashStyle,
2358
2444
  fieldDashStyles: lineDashStylesByFieldStr,
@@ -2381,7 +2467,10 @@ var TimeSeriesChartWrapper = (props) => {
2381
2467
  yAxisMinorTickSize,
2382
2468
  y2AxisMinorTickSize,
2383
2469
  showYAxisWithZero: showYAxisWithZeroFromOptions,
2384
- showY2AxisWithZero: showY2AxisWithZeroFromOptions
2470
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions,
2471
+ // area only props
2472
+ areaFillOpacity: areaOpacity,
2473
+ chart: chartType
2385
2474
  } = options;
2386
2475
  const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
2387
2476
  const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
@@ -2398,13 +2487,11 @@ var TimeSeriesChartWrapper = (props) => {
2398
2487
  const yAxisMax = parseAxisValue(yAxisMaxRaw);
2399
2488
  const y2AxisMin = parseAxisValue(y2AxisMinRaw);
2400
2489
  const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
2401
- const parseTickInterval = (simpleXMLValue, canvasValue) => {
2402
- if (simpleXMLValue) return Number(simpleXMLValue);
2403
- if (canvasValue) return Number(canvasValue);
2404
- return void 0;
2405
- };
2406
- const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
2407
- const y2AxisMajorTickIntervalNum = parseTickInterval(
2490
+ const yAxisMajorTickIntervalNum = parseTickIntervalOption(
2491
+ yAxisMajorUnitFromSimpleXML,
2492
+ yAxisMajorTickInterval
2493
+ );
2494
+ const y2AxisMajorTickIntervalNum = parseTickIntervalOption(
2408
2495
  y2AxisMajorUnitFromSimpleXML,
2409
2496
  y2AxisMajorTickInterval
2410
2497
  );
@@ -2413,6 +2500,7 @@ var TimeSeriesChartWrapper = (props) => {
2413
2500
  const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
2414
2501
  const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
2415
2502
  const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
2503
+ const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
2416
2504
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
2417
2505
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
2418
2506
  const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
@@ -2443,26 +2531,40 @@ var TimeSeriesChartWrapper = (props) => {
2443
2531
  );
2444
2532
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
2445
2533
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
2446
- const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2447
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
2448
- yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
2449
- const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
2450
- let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
2451
- y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
2534
+ const { yAxisTitle, y2AxisTitle } = getYAxisTitles({
2535
+ y2Enabled,
2536
+ yFields,
2537
+ y2Fields,
2538
+ overlayFields,
2539
+ yAxisTitleText,
2540
+ yAxisTitleVisibility,
2541
+ y2AxisTitleText,
2542
+ y2AxisTitleVisibility,
2543
+ containerHeight
2544
+ });
2452
2545
  const xScaleConfig = (0, react_exports.useMemo)(
2453
2546
  () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
2454
2547
  [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
2455
2548
  );
2549
+ const isStacked100 = stackMode === "stacked100";
2456
2550
  const yScaleConfig = (0, react_exports.useMemo)(
2457
- () => getYScaleConfig(
2458
- yAxisTitle,
2459
- yAxisAbbreviation,
2460
- yAxisScale,
2461
- yAxisLabelVisibility,
2462
- yAxisMin,
2463
- yAxisMax
2464
- ),
2465
- [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
2551
+ () => {
2552
+ const config2 = getYScaleConfig(
2553
+ yAxisTitle,
2554
+ yAxisAbbreviation,
2555
+ yAxisScale,
2556
+ yAxisLabelVisibility,
2557
+ yAxisMin,
2558
+ yAxisMax
2559
+ );
2560
+ if (isStacked100) {
2561
+ config2.y.tickFmt = (v) => `${Math.round(v * 100)}%`;
2562
+ config2.y.range = () => [0, 1];
2563
+ }
2564
+ return config2;
2565
+ },
2566
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2567
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax, isStacked100]
2466
2568
  );
2467
2569
  const y2ScaleConfig = (0, react_exports.useMemo)(() => {
2468
2570
  if (y2Enabled) {
@@ -2494,10 +2596,11 @@ var TimeSeriesChartWrapper = (props) => {
2494
2596
  ];
2495
2597
  chartData.fields = filteredChartData.fields;
2496
2598
  chartData.columns = seriesDataFormatted;
2599
+ const normalizedStackMode = stackMode === "stacked" || stackMode === "stacked100" ? stackMode : "auto";
2497
2600
  const seriesOverrides = (0, react_exports.useMemo)(
2498
- () => getSeriesOverrides(
2499
- yFields,
2500
- y2Fields,
2601
+ () => getSeriesOverrides({
2602
+ yfields: yFields,
2603
+ y2fields: y2Fields,
2501
2604
  lineWidth,
2502
2605
  overlayFields,
2503
2606
  y2Enabled,
@@ -2506,8 +2609,11 @@ var TimeSeriesChartWrapper = (props) => {
2506
2609
  lineDashStyle,
2507
2610
  lineDashStylesByField,
2508
2611
  stepPosition,
2509
- stepPositionsByField
2510
- ),
2612
+ stepPositionsByField,
2613
+ type: chartType,
2614
+ stackMode: normalizedStackMode,
2615
+ showLines
2616
+ }),
2511
2617
  [
2512
2618
  yFields,
2513
2619
  y2Fields,
@@ -2519,7 +2625,10 @@ var TimeSeriesChartWrapper = (props) => {
2519
2625
  lineDashStyle,
2520
2626
  lineDashStylesByField,
2521
2627
  stepPosition,
2522
- stepPositionsByField
2628
+ stepPositionsByField,
2629
+ chartType,
2630
+ normalizedStackMode,
2631
+ showLines
2523
2632
  ]
2524
2633
  );
2525
2634
  const chartingEventAnnotations = (0, react_exports.useMemo)(
@@ -2587,50 +2696,54 @@ var TimeSeriesChartWrapper = (props) => {
2587
2696
  react_exports.useEffect(() => {
2588
2697
  additionalTooltipValuesRef.current = additionalTooltipValues;
2589
2698
  }, [additionalTooltipValues]);
2699
+ const handleCrosshairMouseout = react_exports.useCallback(() => {
2700
+ if (onPointMouseOut && lastPayloadRef.current) {
2701
+ onPointMouseOut({
2702
+ type: "point.mouseout",
2703
+ originalEvent: lastOriginalEventRef.current,
2704
+ payload: lastPayloadRef.current
2705
+ });
2706
+ }
2707
+ previousMouseoverPayloadRef.current = null;
2708
+ }, [onPointMouseOut]);
2590
2709
  const handleChartCrosshairChange = react_exports.useCallback(
2591
2710
  (event) => {
2592
- if (onPointMouseOver || onPointMouseOut) {
2593
- if (!event) {
2594
- if (onPointMouseOut && lastPayloadRef.current) {
2595
- onPointMouseOut({
2596
- type: "point.mouseout",
2597
- originalEvent: lastOriginalEventRef.current,
2598
- payload: lastPayloadRef.current
2599
- });
2600
- }
2601
- previousMouseoverPayloadRef.current = null;
2602
- return;
2603
- }
2604
- const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
2605
- name: event.seriesKey
2711
+ if (!onPointMouseOver && !onPointMouseOut) {
2712
+ return;
2713
+ }
2714
+ if (!event) {
2715
+ handleCrosshairMouseout();
2716
+ return;
2717
+ }
2718
+ const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
2719
+ name: event.seriesKey
2720
+ });
2721
+ delete payload.seriesKey;
2722
+ if (event.rowContext) {
2723
+ Object.assign(
2724
+ payload,
2725
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
2726
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2727
+ return acc;
2728
+ }, {})
2729
+ );
2730
+ }
2731
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2732
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2733
+ return;
2734
+ }
2735
+ lastPayloadRef.current = updatedPayload;
2736
+ lastOriginalEventRef.current = event;
2737
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
2738
+ if (onPointMouseOver) {
2739
+ onPointMouseOver({
2740
+ type: "point.mouseover",
2741
+ originalEvent: event,
2742
+ payload: updatedPayload
2606
2743
  });
2607
- delete payload.seriesKey;
2608
- if (event.rowContext) {
2609
- Object.assign(
2610
- payload,
2611
- Object.keys(event.rowContext).reduce((acc, fieldName) => {
2612
- acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2613
- return acc;
2614
- }, {})
2615
- );
2616
- }
2617
- const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2618
- if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2619
- return;
2620
- }
2621
- lastPayloadRef.current = updatedPayload;
2622
- lastOriginalEventRef.current = event;
2623
- previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
2624
- if (onPointMouseOver) {
2625
- onPointMouseOver({
2626
- type: "point.mouseover",
2627
- originalEvent: event,
2628
- payload: updatedPayload
2629
- });
2630
- }
2631
2744
  }
2632
2745
  },
2633
- [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
2746
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy, handleCrosshairMouseout]
2634
2747
  );
2635
2748
  const dataKey = `${(_b = chartData.columns[0]) == null ? void 0 : _b[0]}-${(_c = chartData.columns[0]) == null ? void 0 : _c[chartData.columns[0].length - 1]}-${(_d = chartData.columns[0]) == null ? void 0 : _d.length}`;
2636
2749
  const memoizedChart = (0, react_exports.useMemo)(() => {
@@ -2685,7 +2798,8 @@ var TimeSeriesChartWrapper = (props) => {
2685
2798
  showXAxisLine,
2686
2799
  showYAxisLine,
2687
2800
  showY2AxisLine,
2688
- xAxisMaxLabelParts
2801
+ xAxisMaxLabelParts,
2802
+ areaOpacity: areaOpacityForCanvas
2689
2803
  }
2690
2804
  ));
2691
2805
  }, [
@@ -2737,7 +2851,8 @@ var TimeSeriesChartWrapper = (props) => {
2737
2851
  showYAxisLine,
2738
2852
  showY2AxisLine,
2739
2853
  legendMode,
2740
- xAxisMaxLabelParts
2854
+ xAxisMaxLabelParts,
2855
+ areaOpacityForCanvas
2741
2856
  ]);
2742
2857
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
2743
2858
  return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
@@ -2765,6 +2880,37 @@ var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
2765
2880
 
2766
2881
  // src/common/withDashboardViz.tsx
2767
2882
  var SanitizedTimeSeriesChartWrapper = (0, SanitizeProps_exports.withSanitizedProps)(TimeSeriesChartWrapper_default);
2883
+ var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTrigger) => {
2884
+ const result = {};
2885
+ Object.keys(supportedEvents).forEach((eventName) => {
2886
+ const { parentKeys, payloadKeys } = supportedEvents[eventName];
2887
+ const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
2888
+ let payload = {};
2889
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
2890
+ payloadKeys.forEach((p) => {
2891
+ payload[p] = evaluatedOptionsToUse[p];
2892
+ });
2893
+ }
2894
+ result[eventCallbackPropName] = (ev) => {
2895
+ if (ev == null ? void 0 : ev.payload) {
2896
+ payload = __spreadValues({}, ev.payload);
2897
+ }
2898
+ return onEventTrigger({
2899
+ originalEvent: ev,
2900
+ payload,
2901
+ type: eventName
2902
+ });
2903
+ };
2904
+ if (parentKeys) {
2905
+ for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
2906
+ const newObject = {};
2907
+ newObject[parentKeys[i]] = result[eventCallbackPropName];
2908
+ result[eventCallbackPropName] = newObject;
2909
+ }
2910
+ }
2911
+ });
2912
+ return result;
2913
+ };
2768
2914
  var withDashboardViz = (opts) => {
2769
2915
  const {
2770
2916
  ReactViz,
@@ -2822,9 +2968,7 @@ var withDashboardViz = (opts) => {
2822
2968
  const isDownsamplingEnabledByFeatureFlag = Boolean(
2823
2969
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
2824
2970
  );
2825
- const isTrellisFeatureFlagOn = Boolean(
2826
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
2827
- );
2971
+ const isTrellisFeatureFlagOn = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
2828
2972
  const isTrellisOn = isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
2829
2973
  const isAcceleratedRenderFeatureFlagOn = Boolean(
2830
2974
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
@@ -2989,38 +3133,12 @@ var withDashboardViz = (opts) => {
2989
3133
  }
2990
3134
  );
2991
3135
  }
2992
- const eventCallbackProps = {};
2993
- if (hasEventHandlers && mode === "view" && vizConfig.supports.indexOf("events" /* EVENTS */) > -1) {
2994
- const supportedEvents = vizConfig.events;
2995
- Object.keys(supportedEvents).forEach((eventName) => {
2996
- const { parentKeys, payloadKeys } = supportedEvents[eventName];
2997
- const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
2998
- let payload = {};
2999
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
3000
- payloadKeys.forEach((p) => {
3001
- payload[p] = evaluatedOptionsToUse[p];
3002
- });
3003
- }
3004
- eventCallbackProps[eventCallbackPropName] = (ev) => {
3005
- if (ev == null ? void 0 : ev.payload) {
3006
- payload = __spreadValues({}, ev.payload);
3007
- }
3008
- return onEventTrigger({
3009
- originalEvent: ev,
3010
- payload,
3011
- type: eventName
3012
- });
3013
- };
3014
- if (parentKeys) {
3015
- for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
3016
- const newObject = {};
3017
- newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
3018
- eventCallbackProps[eventCallbackPropName] = newObject;
3019
- }
3020
- }
3021
- });
3022
- }
3023
- const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), eventCallbackProps), {
3136
+ const eventCallbackProps = hasEventHandlers && mode === "view" && vizConfig.supports.includes("events" /* EVENTS */) ? buildEventCallbackProps(vizConfig.events, evaluatedOptionsToUse, onEventTrigger) : {};
3137
+ const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
3138
+ // Align option transformation with the actual renderer selected below.
3139
+ // This prevents canvas-only option preservation from leaking into Highcharts mode.
3140
+ isAcceleratedRenderOn
3141
+ }), eventCallbackProps), {
3024
3142
  themeFunc
3025
3143
  }));
3026
3144
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
@@ -3054,36 +3172,45 @@ var debounce_exports = {};
3054
3172
  __export(debounce_exports, {
3055
3173
  default: () => debounce_default
3056
3174
  });
3057
- var defaultImport36 = __toESM(require("lodash/debounce"));
3175
+ var defaultImport38 = __toESM(require("lodash/debounce"));
3058
3176
  __reExport(debounce_exports, require("lodash/debounce"));
3059
- var debounce_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3177
+ var debounce_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
3060
3178
 
3061
3179
  // esm-externals:@splunk/react-ui/Table
3062
3180
  var Table_exports = {};
3063
3181
  __export(Table_exports, {
3064
3182
  default: () => Table_default
3065
3183
  });
3066
- var defaultImport37 = __toESM(require("@splunk/react-ui/Table"));
3184
+ var defaultImport39 = __toESM(require("@splunk/react-ui/Table"));
3067
3185
  __reExport(Table_exports, require("@splunk/react-ui/Table"));
3068
- var Table_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
3186
+ var Table_default = "default" in defaultImport39 ? defaultImport39.default : defaultImport39;
3069
3187
 
3070
3188
  // esm-externals:@splunk/react-ui/Paginator
3071
3189
  var Paginator_exports = {};
3072
3190
  __export(Paginator_exports, {
3073
3191
  default: () => Paginator_default
3074
3192
  });
3075
- var defaultImport38 = __toESM(require("@splunk/react-ui/Paginator"));
3193
+ var defaultImport40 = __toESM(require("@splunk/react-ui/Paginator"));
3076
3194
  __reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
3077
- var Paginator_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
3195
+ var Paginator_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
3078
3196
 
3079
3197
  // esm-externals:@splunk/react-ui/Message
3080
3198
  var Message_exports2 = {};
3081
3199
  __export(Message_exports2, {
3082
3200
  default: () => Message_default2
3083
3201
  });
3084
- var defaultImport39 = __toESM(require("@splunk/react-ui/Message"));
3202
+ var defaultImport41 = __toESM(require("@splunk/react-ui/Message"));
3085
3203
  __reExport(Message_exports2, require("@splunk/react-ui/Message"));
3086
- var Message_default2 = "default" in defaultImport39 ? defaultImport39.default : defaultImport39;
3204
+ var Message_default2 = "default" in defaultImport41 ? defaultImport41.default : defaultImport41;
3205
+
3206
+ // esm-externals:@splunk/react-ui/JSONTree
3207
+ var JSONTree_exports = {};
3208
+ __export(JSONTree_exports, {
3209
+ default: () => JSONTree_default
3210
+ });
3211
+ var defaultImport42 = __toESM(require("@splunk/react-ui/JSONTree"));
3212
+ __reExport(JSONTree_exports, require("@splunk/react-ui/JSONTree"));
3213
+ var JSONTree_default = "default" in defaultImport42 ? defaultImport42.default : defaultImport42;
3087
3214
 
3088
3215
  // src/Table/hooks.tsx
3089
3216
  var isArray2 = (v) => Array.isArray(v);
@@ -3120,18 +3247,6 @@ var getTextOverflowType = (columnFormat, columnId, tableFormat, currentColumn, d
3120
3247
  }
3121
3248
  return (tableFormat == null ? void 0 : tableFormat.textOverflow) || defaultValue;
3122
3249
  };
3123
- var getTextOverflow = (columnFormat, columnId, tableFormat, currentColumn) => {
3124
- const columnTextOverflow = getAttributeFromColumnFormat(
3125
- "textOverflow",
3126
- columnFormat,
3127
- columnId,
3128
- currentColumn
3129
- );
3130
- if (columnTextOverflow) {
3131
- return columnTextOverflow;
3132
- }
3133
- return tableFormat == null ? void 0 : tableFormat.textOverflow;
3134
- };
3135
3250
  var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInternalFields) => {
3136
3251
  const ret = {
3137
3252
  key: generateKey(value, String(i)),
@@ -3147,10 +3262,8 @@ var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInterna
3147
3262
  const headerAlign = getColumnFormatHeaderAlign(columnFormat, columnId, value) || getTableFormatHeaderAlign(tableFormat) || "left";
3148
3263
  ret.align = headerAlign;
3149
3264
  ret.truncate = true;
3150
- const textOverflow = getTextOverflow(columnFormat, columnId, tableFormat, value);
3151
- if (textOverflow) {
3152
- ret.textOverflowType = textOverflow;
3153
- }
3265
+ const explicitTextOverflow = getAttributeFromColumnFormat("textOverflow", columnFormat, columnId, value) || (tableFormat == null ? void 0 : tableFormat.textOverflow);
3266
+ ret.textOverflowType = explicitTextOverflow || (/\s/.test(value) ? "break-word" : "ellipsis");
3154
3267
  return ret;
3155
3268
  };
3156
3269
  var getColumnFormatAlign = (columnFormat, currentColumn, currentRow) => {
@@ -3414,13 +3527,134 @@ var validValueSelector = (v1, v2, v3, defaultValue) => {
3414
3527
  }
3415
3528
  return defaultValue;
3416
3529
  };
3530
+ var computeBodyRows = (args) => {
3531
+ const rows = [];
3532
+ const {
3533
+ table: t,
3534
+ tableHeader: hdr,
3535
+ columnFormat: cfmt,
3536
+ tableFormat: tfmt,
3537
+ columnIds: cids,
3538
+ showInternalFields: showInternal,
3539
+ longestColumnLength: len,
3540
+ themeFunc: themeFn
3541
+ } = args;
3542
+ for (let r = 0; r < len; r += 1) {
3543
+ const row = { key: `row-${r}`, index: r, cells: [] };
3544
+ t.forEach((column, i) => {
3545
+ const currentHeader = hdr.cells[i];
3546
+ const value = validValueSelector(
3547
+ getColumnFormatData(cfmt, currentHeader, r),
3548
+ getTableFormatData(tfmt, i, r),
3549
+ column[r],
3550
+ ""
3551
+ );
3552
+ const rawValue = column[r];
3553
+ const rowBackgroundColor = getColumnFormatRowBgColor(cfmt, currentHeader, r) || getTableFormatRowBgColor(tfmt, i, r) || getThemeRowBgColor(themeFn, r);
3554
+ const rowColor = getColumnFormatRowColor(cfmt, currentHeader, r) || getTableFormatRowColor(tfmt, i, r) || getThemeRowColor(themeFn);
3555
+ const align = getColumnFormatAlign(cfmt, currentHeader, r) || getTableFormatAlign(tfmt, i, r) || "left";
3556
+ const cellType = getColumnFormatCellType(cfmt, currentHeader, r) || getTableFormatCellType(tfmt, i, r) || "TextCell";
3557
+ const sparklineColor = getColumnFormatSparklineColor(cfmt, currentHeader, r) || getTableFormatSparklineColor(tfmt, i, r) || void 0;
3558
+ const sparklineAreaColor = getColumnFormatSparklineAreaColor(cfmt, currentHeader, r) || getTableFormatSparklineAreaColor(tfmt, i, r) || void 0;
3559
+ const sparklineType = getColumnFormatSparklineType(cfmt, currentHeader, r) || getTableFormatSparklineType(tfmt, i, r) || "area";
3560
+ const sparklineNullValueDisplay = getColumnFormatSparklineNullValueDisplay(cfmt, currentHeader) || getTableFormatSparklineNullValueDisplay(tfmt) || "gaps";
3561
+ const key = generateKey(value, `${r}-${i}`);
3562
+ const textOverflowType = getTextOverflowType(cfmt, cids[i], tfmt, currentHeader.value);
3563
+ const textOverflowStyle = getOverflowStyles({
3564
+ textOverflow: textOverflowType
3565
+ });
3566
+ const showCell = !(!showInternal && currentHeader.value.startsWith("_") && currentHeader.value !== "_time");
3567
+ row.cells.push({
3568
+ key,
3569
+ value,
3570
+ rawValue,
3571
+ align,
3572
+ cellType,
3573
+ rowIndex: r,
3574
+ columnIndex: i,
3575
+ sparklineColor,
3576
+ sparklineAreaColor,
3577
+ sparklineType,
3578
+ sparklineNullValueDisplay,
3579
+ header: currentHeader.value,
3580
+ style: __spreadValues({
3581
+ backgroundColor: rowBackgroundColor,
3582
+ color: rowColor
3583
+ }, textOverflowStyle),
3584
+ showCell
3585
+ });
3586
+ });
3587
+ rows.push(row);
3588
+ }
3589
+ return rows;
3590
+ };
3591
+ var prependRowNumberColumn = (table, headers, columnIds, tableFormat, longestColumnLength, paginationOffset, count) => {
3592
+ const correctedPaginationOffset = Math.max(0, (paginationOffset - 1) * count);
3593
+ const newHeaders = ["#", ...headers];
3594
+ const newColumnIds = ["#", ...columnIds];
3595
+ const newTable = [
3596
+ Array.from({ length: longestColumnLength }, (v, i) => correctedPaginationOffset + i + 1),
3597
+ ...table
3598
+ ];
3599
+ const newTableFormat = __spreadValues({}, tableFormat);
3600
+ if (isArray2(newTableFormat.align)) {
3601
+ newTableFormat.align = [
3602
+ new Array(longestColumnLength).fill("left"),
3603
+ ...newTableFormat.align
3604
+ ];
3605
+ }
3606
+ if (isArray2(newTableFormat.cellTypes)) {
3607
+ newTableFormat.cellTypes = [
3608
+ new Array(longestColumnLength).fill("TextCell"),
3609
+ ...newTableFormat.cellTypes
3610
+ ];
3611
+ }
3612
+ if (isArray2(newTableFormat.data)) {
3613
+ newTableFormat.data = [
3614
+ Array.from({ length: longestColumnLength }, (v, i) => `${i + 1}`),
3615
+ ...newTableFormat.data
3616
+ ];
3617
+ }
3618
+ if (isArray2(newTableFormat.rowBackgroundColors)) {
3619
+ if (newTableFormat.rowBackgroundColors.length > 0 && isArray2(newTableFormat.rowBackgroundColors[0])) {
3620
+ newTableFormat.rowBackgroundColors = [
3621
+ new Array(longestColumnLength),
3622
+ ...newTableFormat.rowBackgroundColors
3623
+ ];
3624
+ }
3625
+ }
3626
+ if (isArray2(newTableFormat.rowColors)) {
3627
+ if (newTableFormat.rowColors.length > 0 && isArray2(newTableFormat.rowColors[0])) {
3628
+ newTableFormat.rowColors = [
3629
+ new Array(longestColumnLength),
3630
+ ...newTableFormat.rowColors
3631
+ ];
3632
+ }
3633
+ }
3634
+ if (isArray2(newTableFormat.sparklineColors)) {
3635
+ newTableFormat.sparklineColors = [new Array(longestColumnLength), ...newTableFormat.sparklineColors];
3636
+ }
3637
+ if (isArray2(newTableFormat.sparklineAreaColors)) {
3638
+ newTableFormat.sparklineAreaColors = [
3639
+ new Array(longestColumnLength),
3640
+ ...newTableFormat.sparklineAreaColors
3641
+ ];
3642
+ }
3643
+ if (isArray2(newTableFormat.sparklineTypes)) {
3644
+ newTableFormat.sparklineTypes = [
3645
+ new Array(longestColumnLength).fill("area"),
3646
+ ...newTableFormat.sparklineTypes
3647
+ ];
3648
+ }
3649
+ return { table: newTable, headers: newHeaders, columnIds: newColumnIds, tableFormat: newTableFormat };
3650
+ };
3417
3651
  var useTable = (tableArgs = {}) => {
3418
3652
  let { table = [], headers = [], columnIds = [] } = tableArgs;
3419
3653
  const {
3420
3654
  headerVisibility = "inline",
3421
3655
  showRowNumbers = false,
3422
3656
  showInternalFields = true,
3423
- tableFormat = {},
3657
+ tableFormat: tableFormatIn = {},
3424
3658
  columnFormat = {},
3425
3659
  paginationOffset = 0,
3426
3660
  count = 0,
@@ -3428,64 +3662,18 @@ var useTable = (tableArgs = {}) => {
3428
3662
  showFooterPercentages = false,
3429
3663
  themeFunc
3430
3664
  } = tableArgs;
3665
+ let tableFormat = tableFormatIn;
3431
3666
  const longestColumnLength = Math.max(...table.map((column) => column.length));
3432
3667
  if (showRowNumbers) {
3433
- const correctedPaginationOffset = Math.max(0, (paginationOffset - 1) * count);
3434
- headers = ["#", ...headers];
3435
- columnIds = ["#", ...columnIds];
3436
- table = [
3437
- Array.from({ length: longestColumnLength }, (v, i) => correctedPaginationOffset + i + 1),
3438
- ...table
3439
- ];
3440
- if (isArray2(tableFormat.align)) {
3441
- tableFormat.align = [
3442
- new Array(longestColumnLength).fill("left"),
3443
- ...tableFormat.align
3444
- ];
3445
- }
3446
- if (isArray2(tableFormat.cellTypes)) {
3447
- tableFormat.cellTypes = [
3448
- new Array(longestColumnLength).fill("TextCell"),
3449
- ...tableFormat.cellTypes
3450
- ];
3451
- }
3452
- if (isArray2(tableFormat.data)) {
3453
- tableFormat.data = [
3454
- Array.from({ length: longestColumnLength }, (v, i) => `${i + 1}`),
3455
- ...tableFormat.data
3456
- ];
3457
- }
3458
- if (isArray2(tableFormat.rowBackgroundColors)) {
3459
- if (tableFormat.rowBackgroundColors.length > 0 && isArray2(tableFormat.rowBackgroundColors[0])) {
3460
- tableFormat.rowBackgroundColors = [
3461
- new Array(longestColumnLength),
3462
- ...tableFormat.rowBackgroundColors
3463
- ];
3464
- }
3465
- }
3466
- if (isArray2(tableFormat.rowColors)) {
3467
- if (tableFormat.rowColors.length > 0 && isArray2(tableFormat.rowColors[0])) {
3468
- tableFormat.rowColors = [
3469
- new Array(longestColumnLength),
3470
- ...tableFormat.rowColors
3471
- ];
3472
- }
3473
- }
3474
- if (isArray2(tableFormat.sparklineColors)) {
3475
- tableFormat.sparklineColors = [new Array(longestColumnLength), ...tableFormat.sparklineColors];
3476
- }
3477
- if (isArray2(tableFormat.sparklineAreaColors)) {
3478
- tableFormat.sparklineAreaColors = [
3479
- new Array(longestColumnLength),
3480
- ...tableFormat.sparklineAreaColors
3481
- ];
3482
- }
3483
- if (isArray2(tableFormat.sparklineTypes)) {
3484
- tableFormat.sparklineTypes = [
3485
- new Array(longestColumnLength).fill("area"),
3486
- ...tableFormat.sparklineTypes
3487
- ];
3488
- }
3668
+ ({ table, headers, columnIds, tableFormat } = prependRowNumberColumn(
3669
+ table,
3670
+ headers,
3671
+ columnIds,
3672
+ tableFormat,
3673
+ longestColumnLength,
3674
+ paginationOffset,
3675
+ count
3676
+ ));
3489
3677
  }
3490
3678
  const tableHeader = {
3491
3679
  visibility: visualization_schemas_exports.validHeaderVisibilities.indexOf(headerVisibility) >= 0 ? headerVisibility : "inline",
@@ -3511,67 +3699,6 @@ var useTable = (tableArgs = {}) => {
3511
3699
  const tableFooter = {
3512
3700
  rows: []
3513
3701
  };
3514
- const computeBodyRows = (args) => {
3515
- const rows = [];
3516
- const {
3517
- table: t,
3518
- tableHeader: hdr,
3519
- columnFormat: cfmt,
3520
- tableFormat: tfmt,
3521
- columnIds: cids,
3522
- showInternalFields: showInternal,
3523
- longestColumnLength: len,
3524
- themeFunc: themeFn
3525
- } = args;
3526
- for (let r = 0; r < len; r += 1) {
3527
- const row = { key: `row-${r}`, index: r, cells: [] };
3528
- t.forEach((column, i) => {
3529
- const currentHeader = hdr.cells[i];
3530
- const value = validValueSelector(
3531
- getColumnFormatData(cfmt, currentHeader, r),
3532
- getTableFormatData(tfmt, i, r),
3533
- column[r],
3534
- ""
3535
- );
3536
- const rawValue = column[r];
3537
- const rowBackgroundColor = getColumnFormatRowBgColor(cfmt, currentHeader, r) || getTableFormatRowBgColor(tfmt, i, r) || getThemeRowBgColor(themeFn, r);
3538
- const rowColor = getColumnFormatRowColor(cfmt, currentHeader, r) || getTableFormatRowColor(tfmt, i, r) || getThemeRowColor(themeFn);
3539
- const align = getColumnFormatAlign(cfmt, currentHeader, r) || getTableFormatAlign(tfmt, i, r) || "left";
3540
- const cellType = getColumnFormatCellType(cfmt, currentHeader, r) || getTableFormatCellType(tfmt, i, r) || "TextCell";
3541
- const sparklineColor = getColumnFormatSparklineColor(cfmt, currentHeader, r) || getTableFormatSparklineColor(tfmt, i, r) || void 0;
3542
- const sparklineAreaColor = getColumnFormatSparklineAreaColor(cfmt, currentHeader, r) || getTableFormatSparklineAreaColor(tfmt, i, r) || void 0;
3543
- const sparklineType = getColumnFormatSparklineType(cfmt, currentHeader, r) || getTableFormatSparklineType(tfmt, i, r) || "area";
3544
- const sparklineNullValueDisplay = getColumnFormatSparklineNullValueDisplay(cfmt, currentHeader) || getTableFormatSparklineNullValueDisplay(tfmt) || "gaps";
3545
- const key = generateKey(value, `${r}-${i}`);
3546
- const textOverflowType = getTextOverflowType(cfmt, cids[i], tfmt, currentHeader.value);
3547
- const textOverflowStyle = getOverflowStyles({
3548
- textOverflow: textOverflowType
3549
- });
3550
- const showCell = !(!showInternal && currentHeader.value.charAt(0) === "_" && currentHeader.value !== "_time");
3551
- row.cells.push({
3552
- key,
3553
- value,
3554
- rawValue,
3555
- align,
3556
- cellType,
3557
- rowIndex: r,
3558
- columnIndex: i,
3559
- sparklineColor,
3560
- sparklineAreaColor,
3561
- sparklineType,
3562
- sparklineNullValueDisplay,
3563
- header: currentHeader.value,
3564
- style: __spreadValues({
3565
- backgroundColor: rowBackgroundColor,
3566
- color: rowColor
3567
- }, textOverflowStyle),
3568
- showCell
3569
- });
3570
- });
3571
- rows.push(row);
3572
- }
3573
- return rows;
3574
- };
3575
3702
  tableBody.rows = computeBodyRows({
3576
3703
  table,
3577
3704
  tableHeader,
@@ -3615,6 +3742,7 @@ var useTable = (tableArgs = {}) => {
3615
3742
  key: `${key}-${colIdx}`,
3616
3743
  value: displayValue,
3617
3744
  align: derivedAlign,
3745
+ showCell: colMeta.showCell,
3618
3746
  style: __spreadValues(__spreadValues({
3619
3747
  backgroundColor: ((_f = tableHeader.style) == null ? void 0 : _f.backgroundColor) || ((_g = tableHeader.style) == null ? void 0 : _g.color),
3620
3748
  color: (_h = tableHeader.style) == null ? void 0 : _h.color
@@ -3638,6 +3766,38 @@ var useTable = (tableArgs = {}) => {
3638
3766
  };
3639
3767
  };
3640
3768
 
3769
+ // esm-externals:@splunk/react-ui/Link
3770
+ var Link_exports = {};
3771
+ __export(Link_exports, {
3772
+ default: () => Link_default
3773
+ });
3774
+ var defaultImport43 = __toESM(require("@splunk/react-ui/Link"));
3775
+ __reExport(Link_exports, require("@splunk/react-ui/Link"));
3776
+ var Link_default = "default" in defaultImport43 ? defaultImport43.default : defaultImport43;
3777
+
3778
+ // esm-externals:@splunk/themes
3779
+ var themes_exports = {};
3780
+ __export(themes_exports, {
3781
+ default: () => themes_default
3782
+ });
3783
+ var defaultImport44 = __toESM(require("@splunk/themes"));
3784
+ __reExport(themes_exports, require("@splunk/themes"));
3785
+ var themes_default = "default" in defaultImport44 ? defaultImport44.default : defaultImport44;
3786
+
3787
+ // src/common/StyledSkipLink.tsx
3788
+ var StyledSkipLink = styled_components_default(Link_default)`
3789
+ ${themes_exports.mixins.skipLink()};
3790
+ &:not([disabled], [aria-disabled='true']) {
3791
+ background-color: ${themes_exports.variables.backgroundColorSection};
3792
+ }
3793
+ &&& {
3794
+ text-decoration: none;
3795
+ }
3796
+ &:focus {
3797
+ z-index: ${themes_exports.variables.zindexLayer};
3798
+ }
3799
+ `;
3800
+
3641
3801
  // src/Table/cells/SwitchTableCell.tsx
3642
3802
  var SwitchTableCell = ({ type, children }) => children.filter((child) => child.type.displayName === type);
3643
3803
 
@@ -3685,9 +3845,20 @@ var ArrayCell = ({ cell, useMouseOverEffect }) => {
3685
3845
  const _a = style, { whiteSpace, overflow, textOverflow, wordBreak, wordWrap, overflowWrap } = _a, rest = __objRest(_a, ["whiteSpace", "overflow", "textOverflow", "wordBreak", "wordWrap", "overflowWrap"]);
3686
3846
  return {
3687
3847
  cellStyle: rest,
3688
- itemStyle: { whiteSpace, overflow, textOverflow, wordBreak, wordWrap, overflowWrap }
3848
+ // flex-direction:column (set on StyledTableCell) makes justify-content control the
3849
+ // vertical axis, so the Cell's `align` prop no longer drives horizontal alignment.
3850
+ // Explicitly mirror cell.align as textAlign on each item to restore the behaviour.
3851
+ itemStyle: {
3852
+ whiteSpace,
3853
+ overflow,
3854
+ textOverflow,
3855
+ wordBreak,
3856
+ wordWrap,
3857
+ overflowWrap,
3858
+ textAlign: cell.align
3859
+ }
3689
3860
  };
3690
- }, [cell.style]);
3861
+ }, [cell.style, cell.align]);
3691
3862
  return /* @__PURE__ */ react_exports.createElement(
3692
3863
  StyledTableCell,
3693
3864
  {
@@ -3719,11 +3890,11 @@ var Popover_exports = {};
3719
3890
  __export(Popover_exports, {
3720
3891
  default: () => Popover_default
3721
3892
  });
3722
- var defaultImport40 = __toESM(require("@splunk/react-ui/Popover"));
3893
+ var defaultImport45 = __toESM(require("@splunk/react-ui/Popover"));
3723
3894
  __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
3724
- var Popover_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
3895
+ var Popover_default = "default" in defaultImport45 ? defaultImport45.default : defaultImport45;
3725
3896
 
3726
- // src/SparkLine/SparkLine.jsx
3897
+ // src/SparkLine/SparkLine.tsx
3727
3898
  var StyledSvg = styled_components_default.svg`
3728
3899
  /* For fixing IE11 shows overflow part line issue */
3729
3900
  overflow: hidden;
@@ -3735,233 +3906,262 @@ var StyledTooltip = styled_components_default.div`
3735
3906
  min-width: 20px;
3736
3907
  `;
3737
3908
  var preventDefault = (e) => e.preventDefault();
3738
- var _SparkLine = class _SparkLine extends react_exports.Component {
3739
- constructor(props, ...rest) {
3740
- super(props, ...rest);
3741
- __publicField(this, "handleCursorMount", (el) => {
3742
- this.setState({
3743
- anchor: el
3744
- });
3745
- });
3746
- this.state = {
3747
- anchor: null,
3748
- activeIndex: 0,
3749
- hoveredIndex: null,
3750
- componentIsFocused: false
3751
- };
3752
- this.titleId = (0, id_exports.createDOMID)("sparkline-title");
3753
- this.pointRefs = [];
3754
- this.containerRef = react_default.createRef();
3755
- this.handleKeyDown = this.handleKeyDown.bind(this);
3756
- this.handleMouseOver = this.handleMouseOver.bind(this);
3757
- this.handleMouseLeave = this.handleMouseLeave.bind(this);
3758
- this.handleFocus = this.handleFocus.bind(this);
3759
- this.handleBlur = this.handleBlur.bind(this);
3760
- }
3761
- handleFocus(event) {
3762
- const { target } = event;
3763
- const { pointIndex: pointIndexStr } = target.dataset || {};
3764
- const { activeIndex, componentIsFocused, hoveredIndex } = this.state;
3765
- if (pointIndexStr !== void 0) {
3766
- const pointIndex = Number.parseInt(pointIndexStr, 10);
3767
- if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
3768
- this.setState({
3769
- activeIndex: pointIndex,
3770
- hoveredIndex: null,
3771
- componentIsFocused: true
3772
- });
3909
+ var PROP_KEYS = [
3910
+ "acceptNull",
3911
+ "data",
3912
+ "elementRef",
3913
+ "endDotCount",
3914
+ "endDotFillColor",
3915
+ "endDotRadius",
3916
+ "endDotStroke",
3917
+ "endDotStrokeWidth",
3918
+ "fillColor",
3919
+ "fillOpacity",
3920
+ "cursorStroke",
3921
+ "cursorStrokeWidth",
3922
+ "cursorStrokeLinecap",
3923
+ "cursorStrokeDasharray",
3924
+ "height",
3925
+ "isArea",
3926
+ "lineColor",
3927
+ "lineLength",
3928
+ "lineStrokeWidth",
3929
+ "showEndDot",
3930
+ "showTooltip",
3931
+ "yMax",
3932
+ "yMin",
3933
+ "width",
3934
+ "title"
3935
+ ];
3936
+ var SparkLineInner = (_a) => {
3937
+ var _b = _a, {
3938
+ acceptNull = false,
3939
+ data = [],
3940
+ elementRef,
3941
+ endDotCount = 0,
3942
+ endDotFillColor = "white",
3943
+ endDotRadius = 0,
3944
+ endDotStroke = "black",
3945
+ endDotStrokeWidth = 0,
3946
+ fillColor = "#65a637",
3947
+ fillOpacity = ".1",
3948
+ cursorStroke = "#5184AF",
3949
+ cursorStrokeWidth = 3,
3950
+ cursorStrokeLinecap = "square",
3951
+ cursorStrokeDasharray = "1, 5",
3952
+ height,
3953
+ isArea = false,
3954
+ lineColor = "#65a637",
3955
+ lineLength,
3956
+ lineStrokeWidth = 1,
3957
+ showEndDot = false,
3958
+ showTooltip = true,
3959
+ yMax,
3960
+ yMin,
3961
+ width,
3962
+ title
3963
+ } = _b, restProps = __objRest(_b, [
3964
+ "acceptNull",
3965
+ "data",
3966
+ "elementRef",
3967
+ "endDotCount",
3968
+ "endDotFillColor",
3969
+ "endDotRadius",
3970
+ "endDotStroke",
3971
+ "endDotStrokeWidth",
3972
+ "fillColor",
3973
+ "fillOpacity",
3974
+ "cursorStroke",
3975
+ "cursorStrokeWidth",
3976
+ "cursorStrokeLinecap",
3977
+ "cursorStrokeDasharray",
3978
+ "height",
3979
+ "isArea",
3980
+ "lineColor",
3981
+ "lineLength",
3982
+ "lineStrokeWidth",
3983
+ "showEndDot",
3984
+ "showTooltip",
3985
+ "yMax",
3986
+ "yMin",
3987
+ "width",
3988
+ "title"
3989
+ ]);
3990
+ const [anchor, setAnchor] = (0, react_exports.useState)(null);
3991
+ const [activeIndex, setActiveIndex] = (0, react_exports.useState)(0);
3992
+ const [hoveredIndex, setHoveredIndex] = (0, react_exports.useState)(null);
3993
+ const [componentIsFocused, setComponentIsFocused] = (0, react_exports.useState)(false);
3994
+ const titleId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("sparkline-title"), []);
3995
+ const pointRefs = (0, react_exports.useRef)([]);
3996
+ const containerRef = (0, react_exports.useRef)(null);
3997
+ const fillNull = (0, react_exports.useCallback)(() => data.map((value) => value != null ? value : 0), [data]);
3998
+ const getMax = (0, react_exports.useCallback)(() => {
3999
+ const dataMax = () => acceptNull ? (0, lodash_exports.max)(fillNull()) : (0, lodash_exports.max)(data);
4000
+ return yMax != null ? yMax : dataMax();
4001
+ }, [acceptNull, data, fillNull, yMax]);
4002
+ const getMin = (0, react_exports.useCallback)(() => {
4003
+ const dataMin = () => acceptNull ? (0, lodash_exports.min)(fillNull()) : (0, lodash_exports.min)(data);
4004
+ return yMin != null ? yMin : dataMin();
4005
+ }, [acceptNull, data, fillNull, yMin]);
4006
+ const getXUnit = (0, react_exports.useCallback)(
4007
+ (xMargin2) => {
4008
+ const xUnit = (width - xMargin2 * 2) / (data.length > 1 ? data.length - 1 : 1);
4009
+ return Math.max(0, xUnit);
4010
+ },
4011
+ [data.length, width]
4012
+ );
4013
+ const getYUnit = (0, react_exports.useCallback)(
4014
+ (yMargin2) => {
4015
+ const maxValue = getMax();
4016
+ const minValue = getMin();
4017
+ const yUnit = (height - yMargin2 * 2) / (maxValue - minValue || 2);
4018
+ return Math.max(0, yUnit);
4019
+ },
4020
+ [getMax, getMin, height]
4021
+ );
4022
+ const getSegmentSets = (0, react_exports.useCallback)(
4023
+ (segmentData, points2) => {
4024
+ const lines = [];
4025
+ const isolatedPoints = [];
4026
+ let currentLine = [];
4027
+ for (const [idx, p] of segmentData.entries()) {
4028
+ if (!acceptNull && (0, lodash_exports.isNull)(p)) {
4029
+ if (currentLine.length > 1) {
4030
+ lines.push(currentLine);
4031
+ } else if (currentLine.length === 1) {
4032
+ isolatedPoints.push(currentLine[0]);
4033
+ }
4034
+ currentLine = [];
4035
+ } else {
4036
+ currentLine.push(points2[idx]);
4037
+ }
3773
4038
  }
3774
- } else if (this.pointRefs.length > 0) {
3775
- const indexToFocus = activeIndex ? Math.min(this.pointRefs.length - 1, activeIndex) : 0;
3776
- this.pointRefs[indexToFocus].focus();
3777
- }
3778
- }
3779
- handleBlur(event) {
3780
- if (this.containerRef.current && !this.containerRef.current.contains(event.relatedTarget)) {
3781
- this.setState({ componentIsFocused: false });
3782
- }
3783
- }
3784
- handleKeyDown(event) {
3785
- const { data } = this.props;
3786
- const { activeIndex } = this.state;
3787
- const numPoints = data.length;
3788
- if (numPoints === 0) {
3789
- return;
3790
- }
3791
- const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
3792
- if (!allowedKeys.includes(event.key)) {
3793
- return;
4039
+ if (currentLine.length > 1) {
4040
+ lines.push(currentLine);
4041
+ } else if (currentLine.length === 1) {
4042
+ isolatedPoints.push(currentLine[0]);
4043
+ }
4044
+ return { lines, isolatedPoints };
4045
+ },
4046
+ [acceptNull]
4047
+ );
4048
+ const dataToPoints = (0, react_exports.useCallback)(
4049
+ (xMargin2, yMargin2) => {
4050
+ const xUnit = getXUnit(xMargin2);
4051
+ const yUnit = getYUnit(yMargin2);
4052
+ const maxValue = getMax();
4053
+ const minValue = getMin();
4054
+ return data.map((val, idx) => ({
4055
+ x: idx * xUnit + xMargin2,
4056
+ y: maxValue === minValue ? yUnit + yMargin2 : (maxValue - val) * yUnit + yMargin2
4057
+ })).map((p) => [p.x, p.y]);
4058
+ },
4059
+ [data, getMax, getMin, getXUnit, getYUnit]
4060
+ );
4061
+ const handleFocus = (0, react_exports.useCallback)(
4062
+ (event) => {
4063
+ const { target } = event;
4064
+ const { pointIndex: pointIndexStr } = target.dataset || {};
4065
+ if (pointIndexStr !== void 0) {
4066
+ const pointIndex = Number.parseInt(pointIndexStr, 10);
4067
+ if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
4068
+ setActiveIndex(pointIndex);
4069
+ setHoveredIndex(null);
4070
+ setComponentIsFocused(true);
4071
+ }
4072
+ } else if (pointRefs.current.length > 0) {
4073
+ const indexToFocus = activeIndex ? Math.min(pointRefs.current.length - 1, activeIndex) : 0;
4074
+ pointRefs.current[indexToFocus].focus();
4075
+ }
4076
+ },
4077
+ [activeIndex, componentIsFocused, hoveredIndex]
4078
+ );
4079
+ const handleBlur = (0, react_exports.useCallback)((event) => {
4080
+ if (containerRef.current && !containerRef.current.contains(event.relatedTarget)) {
4081
+ setComponentIsFocused(false);
3794
4082
  }
3795
- let newIndex;
3796
- switch (event.key) {
3797
- case "Home":
4083
+ }, []);
4084
+ const handleKeyDown = (0, react_exports.useCallback)(
4085
+ (event) => {
4086
+ const numPoints = data.length;
4087
+ const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
4088
+ if (!allowedKeys.includes(event.key)) {
4089
+ return;
4090
+ }
4091
+ let newIndex;
4092
+ if (event.key === "Home") {
3798
4093
  newIndex = 0;
3799
- break;
3800
- case "End":
4094
+ } else if (event.key === "End") {
3801
4095
  newIndex = numPoints - 1;
3802
- break;
3803
- case "ArrowLeft":
4096
+ } else if (event.key === "ArrowLeft") {
3804
4097
  newIndex = Math.max(0, activeIndex - 1);
3805
- break;
3806
- case "ArrowRight":
4098
+ } else {
3807
4099
  newIndex = Math.min(numPoints - 1, activeIndex + 1);
3808
- break;
3809
- default:
3810
- return;
3811
- }
3812
- if (newIndex !== activeIndex) {
3813
- event.preventDefault();
3814
- if (this.pointRefs[newIndex]) {
3815
- this.pointRefs[newIndex].focus();
3816
4100
  }
3817
- }
3818
- }
3819
- handleMouseOver(event) {
3820
- const pointIndexStr = event.target.dataset && event.target.dataset.pointIndex;
3821
- if (pointIndexStr !== void 0) {
3822
- const pointIndex = Number.parseInt(pointIndexStr, 10);
3823
- if (this.state.hoveredIndex !== pointIndex) {
3824
- this.setState({ hoveredIndex: pointIndex });
4101
+ if (newIndex !== activeIndex) {
4102
+ event.preventDefault();
4103
+ if (pointRefs.current[newIndex]) {
4104
+ pointRefs.current[newIndex].focus();
4105
+ }
3825
4106
  }
3826
- }
3827
- }
3828
- handleMouseLeave() {
3829
- if (this.state.hoveredIndex !== null) {
3830
- this.setState({ hoveredIndex: null });
3831
- }
3832
- }
3833
- getMax() {
3834
- const { data, acceptNull, yMax } = this.props;
3835
- const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull()) : (0, lodash_exports.max)(data);
3836
- return yMax === void 0 ? dataMax() : yMax;
3837
- }
3838
- getMin() {
3839
- const { data, acceptNull, yMin } = this.props;
3840
- const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
3841
- return yMin === void 0 ? dataMin() : yMin;
3842
- }
3843
- /**
3844
- * Gets unit value of x axis.
3845
- * @param {Number} xMargin - margin of x axis.
3846
- * @return {Number} unit value of x axis.
3847
- * @private
3848
- */
3849
- getXUnit(xMargin) {
3850
- const { data, width } = this.props;
3851
- const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);
3852
- return Math.max(0, xUnit);
3853
- }
3854
- /**
3855
- * Gets unit value of y axis.
3856
- * @param {String} yMargin - margin of y axis.
3857
- * @return {Number} unit value of y axis.
3858
- * @private
3859
- */
3860
- getYUnit(yMargin) {
3861
- const { height } = this.props;
3862
- const maxValue = this.getMax();
3863
- const minValue = this.getMin();
3864
- const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);
3865
- return Math.max(0, yUnit);
3866
- }
3867
- /**
3868
- * Get a list of arrays of points for drawing lines, based on acceptNull property
3869
- * @method getSegmentSets
3870
- * @param {Array} data
3871
- * @param {Array} points
3872
- * @returns {Object} Object containing lines (arrays of points for polylines) and isolatedPoints (single points surrounded by nulls)
3873
- */
3874
- getSegmentSets(data, points) {
3875
- const { acceptNull } = this.props;
3876
- const lines = [];
3877
- const isolatedPoints = [];
3878
- let currentLine = [];
3879
- for (const [idx, p] of data.entries()) {
3880
- if (!acceptNull && (0, lodash_exports.isNull)(p)) {
3881
- if (currentLine.length > 1) {
3882
- lines.push(currentLine);
3883
- } else if (currentLine.length === 1) {
3884
- isolatedPoints.push(currentLine[0]);
4107
+ },
4108
+ [activeIndex, data.length]
4109
+ );
4110
+ const handleMouseOver = (0, react_exports.useCallback)(
4111
+ (event) => {
4112
+ var _a2;
4113
+ const pointIndexStr = (_a2 = event.target.dataset) == null ? void 0 : _a2.pointIndex;
4114
+ if (pointIndexStr !== void 0) {
4115
+ const pointIndex = Number.parseInt(pointIndexStr, 10);
4116
+ if (hoveredIndex !== pointIndex) {
4117
+ setHoveredIndex(pointIndex);
3885
4118
  }
3886
- currentLine = [];
3887
- } else {
3888
- currentLine.push(points[idx]);
3889
4119
  }
4120
+ },
4121
+ [hoveredIndex]
4122
+ );
4123
+ const handleMouseLeave = (0, react_exports.useCallback)(() => {
4124
+ if (hoveredIndex !== null) {
4125
+ setHoveredIndex(null);
3890
4126
  }
3891
- if (currentLine.length > 1) {
3892
- lines.push(currentLine);
3893
- } else if (currentLine.length === 1) {
3894
- isolatedPoints.push(currentLine[0]);
3895
- }
3896
- return { lines, isolatedPoints };
3897
- }
3898
- /**
3899
- * Utility for fill null value with number 0.
3900
- * @private
3901
- */
3902
- fillNull() {
3903
- const { data } = this.props;
3904
- return data.map((value) => value === null ? 0 : value);
3905
- }
3906
- /**
3907
- * Converts data to points in svg
3908
- * @param {Number} xMargin - margin of x axis.
3909
- * @param {Number} yMargin - margin of x axis.
3910
- * @return {Array} points coordination.
3911
- * @private
3912
- */
3913
- dataToPoints(xMargin, yMargin) {
3914
- const { data } = this.props;
3915
- const xUnit = this.getXUnit(xMargin);
3916
- const yUnit = this.getYUnit(yMargin);
3917
- const maxValue = this.getMax();
3918
- const minValue = this.getMin();
3919
- return data.map((val, idx) => ({
3920
- x: idx * xUnit + xMargin,
3921
- y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin
3922
- })).map((p) => [p.x, p.y]);
3923
- }
3924
- /**
3925
- * Renders rect area for each datapoint for interactions and screen reader support
3926
- * @param {Array} points - array of points coordination.
3927
- * @param {Number} xMargin - margin of x axis.
3928
- * @return {Array} array of svg rect objects
3929
- * @private
3930
- */
3931
- renderRect(points, xMargin) {
3932
- const { data, height, showTooltip } = this.props;
3933
- const xUnit = this.getXUnit(xMargin);
3934
- return points.map((p, i) => (
3935
- /* eslint-disable react/no-array-index-key */
3936
- /* @__PURE__ */ react_default.createElement(
3937
- "rect",
3938
- {
3939
- key: `${i}_${p[0]}`,
3940
- role: "graphics-symbol",
3941
- "aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
3942
- "data-test": `rect-${i}`,
3943
- "data-point-index": i,
3944
- tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
3945
- ref: (el) => {
3946
- this.pointRefs[i] = el;
3947
- },
3948
- x: Math.max(0, p[0] - xUnit / 2),
3949
- y: 0,
3950
- width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
3951
- height,
3952
- style: { fillOpacity: 0 },
3953
- onMouseDown: preventDefault
3954
- }
3955
- )
3956
- ));
3957
- }
3958
- // Renders area chart
3959
- renderArea(points) {
3960
- const { data, fillColor, fillOpacity, height, isArea } = this.props;
3961
- if (!isArea || points.length === 0) {
4127
+ }, [hoveredIndex]);
4128
+ const handleCursorMount = (0, react_exports.useCallback)((el) => {
4129
+ setAnchor(el);
4130
+ }, []);
4131
+ const renderRect = (points2, xMargin2) => {
4132
+ const xUnit = getXUnit(xMargin2);
4133
+ return points2.map((p, i) => {
4134
+ var _a2;
4135
+ return (
4136
+ /* eslint-disable react/no-array-index-key */
4137
+ /* @__PURE__ */ react_default.createElement(
4138
+ "rect",
4139
+ {
4140
+ key: `${i}_${p[0]}`,
4141
+ role: "graphics-symbol",
4142
+ "aria-label": `Value: ${(_a2 = data[i]) != null ? _a2 : "N/A"}, point ${i + 1} of ${data.length}`,
4143
+ "data-test": `rect-${i}`,
4144
+ "data-point-index": i,
4145
+ tabIndex: showTooltip && activeIndex === i ? 0 : -1,
4146
+ ref: (el) => {
4147
+ pointRefs.current[i] = el;
4148
+ },
4149
+ x: Math.max(0, p[0] - xUnit / 2),
4150
+ y: 0,
4151
+ width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
4152
+ height,
4153
+ style: { fillOpacity: 0 },
4154
+ onMouseDown: preventDefault
4155
+ }
4156
+ )
4157
+ );
4158
+ });
4159
+ };
4160
+ const renderArea = (points2) => {
4161
+ if (!isArea || points2.length === 0) {
3962
4162
  return null;
3963
4163
  }
3964
- const { lines } = this.getSegmentSets(data, points);
4164
+ const { lines } = getSegmentSets(data, points2);
3965
4165
  const segments = lines.map(
3966
4166
  (s) => s.concat([
3967
4167
  [s.at(-1)[0], height],
@@ -3985,80 +4185,56 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
3985
4185
  }
3986
4186
  }
3987
4187
  )));
3988
- }
3989
- renderCursor(currentPointX, shouldRender) {
3990
- const { cursorStroke, cursorStrokeWidth, cursorStrokeLinecap, cursorStrokeDasharray, height } = this.props;
3991
- return shouldRender && /* @__PURE__ */ react_default.createElement(
3992
- "line",
3993
- {
3994
- "data-test": "cursor",
3995
- ref: this.handleCursorMount,
3996
- x1: currentPointX,
3997
- y1: 0,
3998
- x2: currentPointX,
3999
- y2: height,
4000
- style: {
4001
- stroke: cursorStroke,
4002
- strokeWidth: cursorStrokeWidth,
4003
- strokeLinecap: cursorStrokeLinecap,
4004
- strokeDasharray: cursorStrokeDasharray
4005
- }
4188
+ };
4189
+ const renderCursor = (currentPointX2, shouldRender) => shouldRender && /* @__PURE__ */ react_default.createElement(
4190
+ "line",
4191
+ {
4192
+ "data-test": "cursor",
4193
+ ref: handleCursorMount,
4194
+ x1: currentPointX2,
4195
+ y1: 0,
4196
+ x2: currentPointX2,
4197
+ y2: height,
4198
+ style: {
4199
+ stroke: cursorStroke,
4200
+ strokeWidth: cursorStrokeWidth,
4201
+ strokeLinecap: cursorStrokeLinecap,
4202
+ strokeDasharray: cursorStrokeDasharray
4006
4203
  }
4007
- );
4008
- }
4009
- renderTooltip(tooltipValue, isOpen) {
4010
- const { anchor } = this.state;
4011
- const displayValue = tooltipValue === null ? "-" : tooltipValue;
4204
+ }
4205
+ );
4206
+ const renderTooltip = (tooltipValue2, isOpen) => {
4207
+ const displayValue = tooltipValue2 === null ? "-" : tooltipValue2;
4012
4208
  return /* @__PURE__ */ react_default.createElement(
4013
4209
  Popover_default,
4014
4210
  {
4015
4211
  "data-test": "tooltip",
4016
4212
  open: isOpen,
4017
4213
  anchor,
4018
- "data-test-value": tooltipValue,
4214
+ "data-test-value": tooltipValue2,
4019
4215
  appearance: "inverted",
4020
4216
  defaultPlacement: "above",
4021
4217
  animation: false
4022
4218
  },
4023
4219
  /* @__PURE__ */ react_default.createElement(StyledTooltip, null, displayValue)
4024
4220
  );
4025
- }
4026
- /**
4027
- * Renders one or more svg circles to highlight values on the sparkline
4028
- * @method renderEndDots
4029
- * @param {Array[Array[Number]]} points // x,y coordinates of values
4030
- * @param {Number} dotsToShow // number of end dots to display
4031
- * @param {Number} xMargin // used when calculating the dot radius
4032
- * @returns {Object} React representation of SVG group
4033
- * @private
4034
- */
4035
- renderEndDots(points, dotsToShow, xMargin) {
4036
- const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;
4037
- return /* @__PURE__ */ react_default.createElement("g", null, points.slice(-dotsToShow).map((point) => /* @__PURE__ */ react_default.createElement(
4038
- "circle",
4039
- {
4040
- key: `end-dot${point[0]}${point[1]}`,
4041
- "data-test": "end-dot",
4042
- cx: point[0],
4043
- cy: point[1],
4044
- r: endDotRadius === 0 ? xMargin : endDotRadius,
4045
- style: {
4046
- fill: endDotFillColor,
4047
- stroke: endDotStroke,
4048
- strokeWidth: endDotStrokeWidth
4049
- }
4221
+ };
4222
+ const renderEndDots = (points2, dotsToShow2, xMargin2) => /* @__PURE__ */ react_default.createElement("g", null, points2.slice(-dotsToShow2).map((point) => /* @__PURE__ */ react_default.createElement(
4223
+ "circle",
4224
+ {
4225
+ key: `end-dot${point[0]}${point[1]}`,
4226
+ "data-test": "end-dot",
4227
+ cx: point[0],
4228
+ cy: point[1],
4229
+ r: endDotRadius === 0 ? xMargin2 : endDotRadius,
4230
+ style: {
4231
+ fill: endDotFillColor,
4232
+ stroke: endDotStroke,
4233
+ strokeWidth: endDotStrokeWidth
4050
4234
  }
4051
- )));
4052
- }
4053
- /**
4054
- * Renders circles for isolated points (single data points surrounded by nulls)
4055
- * These would otherwise be invisible since a line requires at least 2 points
4056
- * @method renderIsolatedPoints
4057
- * @param {Array} isolatedPoints - Array of [x, y] coordinates for isolated points
4058
- * @returns {Object} SVG Group of circles
4059
- */
4060
- renderIsolatedPoints(isolatedPoints) {
4061
- const { lineColor, lineStrokeWidth } = this.props;
4235
+ }
4236
+ )));
4237
+ const renderIsolatedPoints = (isolatedPoints) => {
4062
4238
  if (!isolatedPoints || isolatedPoints.length === 0) {
4063
4239
  return null;
4064
4240
  }
@@ -4076,20 +4252,10 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4076
4252
  }
4077
4253
  }
4078
4254
  )));
4079
- }
4080
- /**
4081
- * Renders the line(s) above the area graph
4082
- * @method renderPolyline
4083
- * @param {Array} points
4084
- * @returns {Object} SVG Group of polylines and isolated points
4085
- */
4086
- renderPolyline(points) {
4087
- const { data, lineColor, lineLength, lineStrokeWidth } = this.props;
4088
- const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points.length;
4089
- const { lines, isolatedPoints } = this.getSegmentSets(
4090
- data.slice(-linePoints),
4091
- points.slice(-linePoints)
4092
- );
4255
+ };
4256
+ const renderPolyline = (points2) => {
4257
+ const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points2.length;
4258
+ const { lines, isolatedPoints } = getSegmentSets(data.slice(-linePoints), points2.slice(-linePoints));
4093
4259
  return /* @__PURE__ */ react_default.createElement("g", { "data-test": "sparkline" }, lines.map((lineData) => /* @__PURE__ */ react_default.createElement(
4094
4260
  "polyline",
4095
4261
  {
@@ -4104,10 +4270,18 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4104
4270
  },
4105
4271
  points: lineData.join(" ")
4106
4272
  }
4107
- )), this.renderIsolatedPoints(isolatedPoints));
4108
- }
4109
- getInteractionState({ data, points, showTooltip, activeIndex, hoveredIndex, componentIsFocused }) {
4110
- if (!showTooltip) {
4273
+ )), renderIsolatedPoints(isolatedPoints));
4274
+ };
4275
+ const getInteractionState = ({
4276
+ interactionData,
4277
+ points: interactionPoints,
4278
+ interactionShowTooltip,
4279
+ interactionActiveIndex,
4280
+ interactionHoveredIndex,
4281
+ interactionComponentIsFocused
4282
+ }) => {
4283
+ var _a2;
4284
+ if (!interactionShowTooltip) {
4111
4285
  return {
4112
4286
  currentPointX: null,
4113
4287
  tooltipValue: null,
@@ -4115,200 +4289,94 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4115
4289
  interactiveProps: {}
4116
4290
  };
4117
4291
  }
4118
- const interactiveProps = {
4119
- onKeyDown: this.handleKeyDown,
4120
- onMouseOver: this.handleMouseOver,
4121
- onMouseLeave: this.handleMouseLeave,
4122
- onFocus: this.handleFocus,
4123
- onBlur: this.handleBlur
4292
+ const interactiveProps2 = {
4293
+ onKeyDown: handleKeyDown,
4294
+ onMouseOver: handleMouseOver,
4295
+ onMouseLeave: handleMouseLeave,
4296
+ onFocus: handleFocus,
4297
+ onBlur: handleBlur
4124
4298
  };
4125
- const isHovered = hoveredIndex !== null;
4126
- const shouldDisplayInteractiveElements = (isHovered || componentIsFocused) && data.length > 0;
4299
+ const isHovered = interactionHoveredIndex !== null;
4300
+ const shouldDisplayInteractiveElements = (isHovered || interactionComponentIsFocused) && interactionData.length > 0;
4127
4301
  if (!shouldDisplayInteractiveElements) {
4128
4302
  return {
4129
4303
  currentPointX: null,
4130
4304
  tooltipValue: null,
4131
4305
  showCursorAndTooltip: false,
4132
- interactiveProps
4306
+ interactiveProps: interactiveProps2
4133
4307
  };
4134
4308
  }
4135
- const displayIndex = isHovered ? hoveredIndex : activeIndex;
4309
+ const displayIndex = isHovered ? interactionHoveredIndex : interactionActiveIndex;
4136
4310
  const isValidIndex = displayIndex !== null && displayIndex >= 0;
4137
- const withinBounds = isValidIndex && displayIndex < data.length && displayIndex < points.length;
4311
+ const withinBounds = isValidIndex && displayIndex < interactionData.length && displayIndex < interactionPoints.length;
4138
4312
  if (!withinBounds) {
4139
4313
  return {
4140
4314
  currentPointX: null,
4141
4315
  tooltipValue: null,
4142
4316
  showCursorAndTooltip: false,
4143
- interactiveProps
4317
+ interactiveProps: interactiveProps2
4144
4318
  };
4145
4319
  }
4146
- const displayPointCoords = points[displayIndex];
4147
- const currentPointX = displayPointCoords ? displayPointCoords[0] : null;
4148
- const tooltipValue = data[displayIndex];
4320
+ const displayPointCoords = interactionPoints[displayIndex];
4321
+ const currentPointX2 = (_a2 = displayPointCoords == null ? void 0 : displayPointCoords[0]) != null ? _a2 : null;
4322
+ const tooltipValue2 = interactionData[displayIndex];
4149
4323
  return {
4150
- currentPointX,
4151
- tooltipValue,
4152
- showCursorAndTooltip: currentPointX !== null,
4153
- interactiveProps
4324
+ currentPointX: currentPointX2,
4325
+ tooltipValue: tooltipValue2,
4326
+ showCursorAndTooltip: currentPointX2 !== null,
4327
+ interactiveProps: interactiveProps2
4154
4328
  };
4329
+ };
4330
+ if (data.length === 0) {
4331
+ return null;
4155
4332
  }
4156
- render() {
4157
- const {
4158
- data,
4159
- elementRef,
4160
- showTooltip,
4161
- showEndDot,
4162
- endDotRadius,
4163
- endDotStrokeWidth,
4164
- endDotCount,
4165
- height,
4166
- isArea,
4167
- lineStrokeWidth,
4168
- width,
4169
- title
4170
- } = this.props;
4171
- const { activeIndex, hoveredIndex, componentIsFocused } = this.state;
4172
- if (data.length === 0) {
4333
+ if (pointRefs.current.length !== data.length) {
4334
+ pointRefs.current.length = data.length;
4335
+ }
4336
+ const xMargin = endDotRadius + endDotStrokeWidth / 2;
4337
+ const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
4338
+ const points = dataToPoints(xMargin, yMargin);
4339
+ const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
4340
+ const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = getInteractionState({
4341
+ interactionData: data,
4342
+ points,
4343
+ interactionShowTooltip: showTooltip,
4344
+ interactionActiveIndex: activeIndex,
4345
+ interactionHoveredIndex: hoveredIndex,
4346
+ interactionComponentIsFocused: componentIsFocused
4347
+ });
4348
+ const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
4349
+ return /* @__PURE__ */ react_default.createElement(
4350
+ "div",
4351
+ __spreadValues(__spreadValues({
4352
+ "data-test": "line",
4353
+ "data-test-type": isArea ? "area" : "line",
4354
+ ref: (el) => {
4355
+ containerRef.current = el;
4356
+ if (typeof elementRef === "function") {
4357
+ elementRef(el);
4358
+ } else if (elementRef && typeof elementRef === "object") {
4359
+ elementRef.current = el;
4360
+ }
4361
+ }
4362
+ }, interactiveProps), (0, lodash_exports.omit)(restProps, PROP_KEYS)),
4363
+ /* @__PURE__ */ react_default.createElement(StyledSvg, { height, width, "aria-labelledby": titleId, "data-test": "sparkline-svg" }, /* @__PURE__ */ react_default.createElement("title", { id: titleId, "data-test": "sparkline-title" }, ariaLabel), /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? renderCursor(currentPointX, showCursorAndTooltip) : null, renderPolyline(points), renderArea(points), dotsToShow ? renderEndDots(points, dotsToShow, xMargin) : null, renderRect(points, xMargin), showTooltip ? renderTooltip(tooltipValue, showCursorAndTooltip) : null))
4364
+ );
4365
+ };
4366
+ var SparkLine = (_a) => {
4367
+ var _b = _a, { data = [] } = _b, props = __objRest(_b, ["data"]);
4368
+ if (true) {
4369
+ if (!Array.isArray(data)) {
4370
+ console.error("Data provided to SparkLine must be an array.");
4173
4371
  return null;
4174
4372
  }
4175
- if (this.pointRefs.length !== data.length) {
4176
- this.pointRefs.length = data.length;
4373
+ if (!data.every((value) => value === null || (0, lodash_exports.isFinite)(value))) {
4374
+ console.error("Data provided to SparkLine must contain finite numbers or null.");
4375
+ return null;
4177
4376
  }
4178
- const xMargin = endDotRadius + endDotStrokeWidth / 2;
4179
- const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
4180
- const points = this.dataToPoints(xMargin, yMargin);
4181
- const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
4182
- const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = this.getInteractionState({
4183
- data,
4184
- points,
4185
- showTooltip,
4186
- activeIndex,
4187
- hoveredIndex,
4188
- componentIsFocused
4189
- });
4190
- const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
4191
- return /* @__PURE__ */ react_default.createElement(
4192
- "div",
4193
- __spreadValues(__spreadValues({
4194
- "data-test": "line",
4195
- "data-test-type": isArea ? "area" : "line",
4196
- ref: (el) => {
4197
- this.containerRef.current = el;
4198
- if (typeof elementRef === "function") {
4199
- elementRef(el);
4200
- } else if (elementRef && typeof elementRef === "object") {
4201
- elementRef.current = el;
4202
- }
4203
- }
4204
- }, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
4205
- /* @__PURE__ */ react_default.createElement(
4206
- StyledSvg,
4207
- {
4208
- height,
4209
- width,
4210
- "aria-labelledby": this.titleId,
4211
- "data-test": "sparkline-svg"
4212
- },
4213
- /* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
4214
- /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
4215
- )
4216
- );
4217
4377
  }
4378
+ return /* @__PURE__ */ react_default.createElement(SparkLineInner, __spreadValues({ data }, props));
4218
4379
  };
4219
- __publicField(_SparkLine, "propTypes", {
4220
- /**
4221
- * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.
4222
- */
4223
- acceptNull: prop_types_default.bool,
4224
- /** Array of numbers. These data numbers are converted to points and show on sparkline. */
4225
- data: (props) => {
4226
- if (!(0, lodash_exports.isArray)(props.data)) {
4227
- return new Error("Data provided to Sparkline must be an array.");
4228
- }
4229
- if (props.acceptNull && !props.data.every((value) => (0, lodash_exports.isNull)(value) || (0, lodash_exports.isFinite)(value))) {
4230
- return new Error("Data provided to Sparkline must be finite numbers or null.");
4231
- }
4232
- if (!props.acceptNull && !props.data.every((value) => (0, lodash_exports.isFinite)(value))) {
4233
- return new Error("Data provided to Sparkline must be finite numbers.");
4234
- }
4235
- return null;
4236
- },
4237
- /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */
4238
- elementRef: prop_types_default.oneOfType([prop_types_default.func, prop_types_default.object]),
4239
- /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */
4240
- endDotCount: prop_types_default.number,
4241
- /** Fills color to the end dot. */
4242
- endDotFillColor: prop_types_default.string,
4243
- /**
4244
- * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.
4245
- */
4246
- endDotRadius: prop_types_default.number,
4247
- /** Sets end dot circle stroke color. */
4248
- endDotStroke: prop_types_default.string,
4249
- /** Sets end dot circle stroke width in pixels. */
4250
- endDotStrokeWidth: prop_types_default.number,
4251
- /** Fills color to area. */
4252
- fillColor: prop_types_default.string,
4253
- /** Fills opacity to area. Value must be in 0 ~ 1. */
4254
- fillOpacity: prop_types_default.string,
4255
- /** Sets cursor stroke color. */
4256
- cursorStroke: prop_types_default.string,
4257
- /** Sets cursor stroke width in pixels. */
4258
- cursorStrokeWidth: prop_types_default.number,
4259
- /** Sets cursor line cap style. */
4260
- cursorStrokeLinecap: prop_types_default.oneOf(["butt", "round", "square"]),
4261
- /** Sets cursor dash array style. */
4262
- cursorStrokeDasharray: prop_types_default.string,
4263
- /**
4264
- * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,
4265
- * sparkline figures out the container height by itself.
4266
- */
4267
- height: prop_types_default.number.isRequired,
4268
- /** When set to `true`, sparkline shows as area. */
4269
- isArea: prop_types_default.bool,
4270
- /** The sparkline line color. */
4271
- lineColor: prop_types_default.string,
4272
- /** Allows user to draw only the last data points for the line. */
4273
- lineLength: prop_types_default.number,
4274
- /** The sparkline line stroke width in pixels. */
4275
- lineStrokeWidth: prop_types_default.number,
4276
- /** Enable to show end dot. */
4277
- showEndDot: prop_types_default.bool,
4278
- /** Enable to show tooltip. */
4279
- showTooltip: prop_types_default.bool,
4280
- /** Sets the data value range and maximum value shown on sparkline. */
4281
- yMax: prop_types_default.number,
4282
- /** Sets the data value range and minimum value shown on sparkline. */
4283
- yMin: prop_types_default.number,
4284
- /**
4285
- * The width of the container.
4286
- */
4287
- width: prop_types_default.number.isRequired,
4288
- /** Sets the a11y title text on sparkline. */
4289
- title: prop_types_default.string
4290
- });
4291
- __publicField(_SparkLine, "defaultProps", {
4292
- acceptNull: false,
4293
- data: [],
4294
- showTooltip: true,
4295
- endDotCount: 0,
4296
- showEndDot: false,
4297
- endDotRadius: 0,
4298
- endDotFillColor: "white",
4299
- endDotStroke: "black",
4300
- endDotStrokeWidth: 0,
4301
- fillColor: "#65a637",
4302
- fillOpacity: ".1",
4303
- cursorStroke: "#5184AF",
4304
- cursorStrokeWidth: 3,
4305
- cursorStrokeLinecap: "square",
4306
- cursorStrokeDasharray: "1, 5",
4307
- isArea: false,
4308
- lineColor: "#65a637",
4309
- lineStrokeWidth: 1
4310
- });
4311
- var SparkLine = _SparkLine;
4312
4380
  var SparkLine_default = SparkLine;
4313
4381
 
4314
4382
  // src/Table/cells/SparklineCell.tsx
@@ -4405,6 +4473,128 @@ SparklineCell.displayName = "SparklineCell";
4405
4473
  // src/common/utils/textUtils.ts
4406
4474
  var VIZ_FONT_FAMILY = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
4407
4475
 
4476
+ // src/common/utils/focusUtils.ts
4477
+ var DEFAULT_FOCUSABLE_SELECTORS = [
4478
+ "a[href]",
4479
+ "button:not([disabled])",
4480
+ "input:not([disabled])",
4481
+ "select:not([disabled])",
4482
+ "textarea:not([disabled])",
4483
+ "[tabindex]:not([disabled]):not([hidden])",
4484
+ "area[href]",
4485
+ "iframe",
4486
+ "object",
4487
+ "embed",
4488
+ '[contenteditable]:not([contenteditable="false"])',
4489
+ "summary",
4490
+ "audio[controls]",
4491
+ "video[controls]"
4492
+ ].join(",");
4493
+ var getFocusableElements = () => {
4494
+ return Array.from(document.querySelectorAll(DEFAULT_FOCUSABLE_SELECTORS));
4495
+ };
4496
+ var isElementHidden = (element) => {
4497
+ const computedStyle = window.getComputedStyle(element);
4498
+ return element.hasAttribute("hidden") || element.getAttribute("aria-hidden") === "true" || computedStyle.display === "none" || computedStyle.visibility === "hidden";
4499
+ };
4500
+ var isVisibleFocusableElement = (element) => {
4501
+ let currentElement = element;
4502
+ while (currentElement) {
4503
+ if (isElementHidden(currentElement)) {
4504
+ return false;
4505
+ }
4506
+ currentElement = currentElement.parentElement;
4507
+ }
4508
+ return true;
4509
+ };
4510
+ var resolveTargetElement = (container, selector) => {
4511
+ if (container instanceof Element && container.matches(selector)) {
4512
+ return container;
4513
+ }
4514
+ return container.querySelector(selector);
4515
+ };
4516
+ var findFirstFocusableElementAfter = (container, selector) => {
4517
+ const targetElement = resolveTargetElement(container, selector);
4518
+ if (!targetElement) {
4519
+ return null;
4520
+ }
4521
+ return getFocusableElements().find((element) => {
4522
+ if (targetElement.contains(element)) {
4523
+ return false;
4524
+ }
4525
+ const relativePosition = targetElement.compareDocumentPosition(element);
4526
+ return relativePosition === Node.DOCUMENT_POSITION_FOLLOWING && isVisibleFocusableElement(element);
4527
+ }) || null;
4528
+ };
4529
+ var findFirstFocusableElementInside = (container, selector) => {
4530
+ const targetElement = resolveTargetElement(container, selector);
4531
+ if (!targetElement) {
4532
+ return null;
4533
+ }
4534
+ return getFocusableElements().find((element) => {
4535
+ return element !== targetElement && targetElement.contains(element) && isVisibleFocusableElement(element);
4536
+ }) || null;
4537
+ };
4538
+ var moveFocusOutside = (container, selector, event) => {
4539
+ var _a;
4540
+ event.preventDefault();
4541
+ (_a = findFirstFocusableElementAfter(container, selector)) == null ? void 0 : _a.focus();
4542
+ };
4543
+ var moveFocusInto = (container, selector, event) => {
4544
+ var _a;
4545
+ event.preventDefault();
4546
+ (_a = findFirstFocusableElementInside(container, selector)) == null ? void 0 : _a.focus();
4547
+ };
4548
+
4549
+ // src/Table/tableUtils.ts
4550
+ var isJSONObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.values(value).every(isJSONElement);
4551
+ var isJSONTreeContent = (value) => Array.isArray(value) && value.every(isJSONElement) || isJSONObject(value);
4552
+ var isJSONElement = (value) => {
4553
+ if (value === void 0 || value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
4554
+ return true;
4555
+ }
4556
+ if (Array.isArray(value)) {
4557
+ return value.every(isJSONElement);
4558
+ }
4559
+ if (typeof value === "object") {
4560
+ return Object.values(value).every(isJSONElement);
4561
+ }
4562
+ return false;
4563
+ };
4564
+ var parseExpandedJson = (value) => {
4565
+ if (value === void 0 || value === null || value === "") {
4566
+ return { isExpandable: true, json: null };
4567
+ }
4568
+ if (typeof value !== "string") {
4569
+ return { isExpandable: true, json: null };
4570
+ }
4571
+ try {
4572
+ const parsedValue = JSON.parse(value);
4573
+ return {
4574
+ isExpandable: true,
4575
+ json: isJSONTreeContent(parsedValue) ? parsedValue : null
4576
+ };
4577
+ } catch (e) {
4578
+ return { isExpandable: true, json: null };
4579
+ }
4580
+ };
4581
+ var getExpandedRowColors = (row) => {
4582
+ var _a, _b, _c, _d;
4583
+ const visibleCells = row.cells.filter((cell) => cell.showCell);
4584
+ const backgroundColor = (_b = (_a = visibleCells.find((cell) => {
4585
+ var _a2;
4586
+ return (_a2 = cell.style) == null ? void 0 : _a2.backgroundColor;
4587
+ })) == null ? void 0 : _a.style) == null ? void 0 : _b.backgroundColor;
4588
+ const color = (_d = (_c = visibleCells.find((cell) => {
4589
+ var _a2;
4590
+ return (_a2 = cell.style) == null ? void 0 : _a2.color;
4591
+ })) == null ? void 0 : _c.style) == null ? void 0 : _d.color;
4592
+ return {
4593
+ backgroundColor,
4594
+ color
4595
+ };
4596
+ };
4597
+
4408
4598
  // src/Table/PureTable.tsx
4409
4599
  var MINIMUM_COLUMN_SIZE = 60;
4410
4600
  var INITIAL_UNSET_COLUMN_WIDTH = 90;
@@ -4430,20 +4620,35 @@ var headerTextOverflowStyles = {
4430
4620
  `,
4431
4621
  anywhere: `
4432
4622
  word-break: break-all;
4433
- white-space: inherit;
4623
+ white-space: pre-wrap;
4624
+ text-overflow: clip;
4434
4625
  display: inline;
4435
4626
  `,
4436
- default: `
4437
- word-break: inherit;
4438
- word-wrap: inherit;
4439
- white-space: inherit;
4440
- display: inline;
4627
+ "break-word": `
4628
+ word-break: normal;
4629
+ overflow-wrap: normal;
4630
+ white-space: normal;
4631
+ overflow: hidden;
4632
+ text-overflow: ellipsis;
4633
+ display: block;
4441
4634
  `
4442
4635
  };
4443
4636
  var TableHeadCell = styled_components_default(Table_default.HeadCell)`
4444
- button > span {
4445
- ${(props) => headerTextOverflowStyles[props.textOverflowType] || headerTextOverflowStyles.default}
4446
- }
4637
+ ${(props) => {
4638
+ const type = props.textOverflowType;
4639
+ const styles = type && headerTextOverflowStyles[type];
4640
+ if (!styles) return "";
4641
+ const expandsHeader = type === "break-word" || type === "anywhere";
4642
+ return styled_components_exports.css`
4643
+ && :is(button, div) {
4644
+ min-height: 100%;
4645
+ ${expandsHeader ? "grid-template-rows: auto 1fr; height: auto;" : ""}
4646
+ }
4647
+ && :is(button, div) > span {
4648
+ ${styles}
4649
+ }
4650
+ `;
4651
+ }}
4447
4652
  `;
4448
4653
  var VizTableContainer = styled_components_default.div`
4449
4654
  box-sizing: border-box;
@@ -4495,28 +4700,32 @@ var SUITableContainer = styled_components_default.div`
4495
4700
  margin-bottom: ${PAGINATOR_SPACING}px;
4496
4701
  `};
4497
4702
 
4498
- ${({ headerStyle }) => headerStyle && headerStyle.backgroundColor && styled_components_exports.css`
4499
- & [data-test='head-cell'] {
4703
+ ${({ headerStyle }) => (headerStyle == null ? void 0 : headerStyle.backgroundColor) && styled_components_exports.css`
4704
+ & th {
4500
4705
  background-color: ${headerStyle.backgroundColor};
4501
4706
  }
4502
4707
  `}
4503
4708
 
4504
- ${({ headerStyle }) => headerStyle && headerStyle.color && styled_components_exports.css`
4709
+ ${({ headerStyle }) => (headerStyle == null ? void 0 : headerStyle.color) && styled_components_exports.css`
4505
4710
  & [data-test='head-cell'] > div > button > span {
4506
4711
  color: ${headerStyle.color};
4507
4712
  }
4508
4713
  `}
4509
4714
 
4510
4715
  /* Footer cells should match header background for both totals and percentages */
4511
- ${({ headerStyle }) => headerStyle && (headerStyle.backgroundColor || headerStyle.color) && styled_components_exports.css`
4716
+ ${({ headerStyle }) => ((headerStyle == null ? void 0 : headerStyle.backgroundColor) || (headerStyle == null ? void 0 : headerStyle.color)) && styled_components_exports.css`
4512
4717
  tr[data-test='footer-row-totals'] td[data-test='cell'],
4513
4718
  tr[data-test='footer-row-percentages'] td[data-test='cell'] {
4514
4719
  background-color: ${headerStyle.backgroundColor || headerStyle.color} !important;
4515
4720
  }
4516
4721
  `}
4517
4722
 
4518
- /* To accomodate custom logic that diverges from default resizableFillLayout behavior - allows the columns to shrink beneath Table width when columns are fixed */
4519
- [data-test="main-table"] {
4723
+ tbody tr td[data-test='expand'] button {
4724
+ background-color: transparent !important;
4725
+ }
4726
+
4727
+ /* To accomodate custom logic that diverges from default resizableFillLayout behavior - allows the columns to shrink beneath Table width when columns are fixed */
4728
+ [data-test='main-table'] {
4520
4729
  ${({ isFullyFixed }) => isFullyFixed && styled_components_exports.css`
4521
4730
  width: fit-content;
4522
4731
  min-width: unset;
@@ -4533,6 +4742,33 @@ var PaginatorContainer = styled_components_default.div`
4533
4742
  height: ${PAGINATOR_CONTAINER_HEIGHT}px;
4534
4743
  `;
4535
4744
  PaginatorContainer.displayName = "PaginatorContainer";
4745
+ var ExpandedJsonTreeContainer = styled_components_default.div`
4746
+ & * {
4747
+ font-family: ${variables_default.monoFontFamily};
4748
+ }
4749
+ `;
4750
+ ExpandedJsonTreeContainer.displayName = "ExpandedJsonTreeContainer";
4751
+ var ExpandableTableRow = styled_components_default(Table_default.Row)`
4752
+ ${({ backgroundColor }) => backgroundColor && styled_components_exports.css`
4753
+ td[data-test='expand'] {
4754
+ background-color: ${backgroundColor} !important;
4755
+ }
4756
+ `}
4757
+
4758
+ td[data-test='expand'] button {
4759
+ background-color: transparent !important;
4760
+ }
4761
+ `;
4762
+ ExpandableTableRow.displayName = "ExpandableTableRow";
4763
+ var ExpandedContentRow = styled_components_default(Table_default.Row)`
4764
+ ${({ backgroundColor, color }) => (backgroundColor || color) && styled_components_exports.css`
4765
+ td {
4766
+ ${backgroundColor ? `background-color: ${backgroundColor};` : ""}
4767
+ ${color ? `color: ${color};` : ""}
4768
+ }
4769
+ `}
4770
+ `;
4771
+ ExpandedContentRow.displayName = "ExpandedContentRow";
4536
4772
  var withEmptyTableMessage = (Viz) => {
4537
4773
  const Wrapper = (props) => {
4538
4774
  const {
@@ -4649,7 +4885,8 @@ var PureTable = (props) => {
4649
4885
  mode,
4650
4886
  headerVisibility,
4651
4887
  font,
4652
- fontSize
4888
+ fontSize,
4889
+ showColumnAsExpandedJson
4653
4890
  } = _a;
4654
4891
  const [columns, setColumns] = react_exports.useState(columnFormat);
4655
4892
  const containerRef = react_exports.useRef(null);
@@ -4672,6 +4909,14 @@ var PureTable = (props) => {
4672
4909
  setColumns(columnFormat);
4673
4910
  }
4674
4911
  }, [columnFormat, mode, stringifiedColumnFormat]);
4912
+ const expandedRowJson = react_exports.useMemo(() => {
4913
+ const rowJsonValues = Array.isArray(showColumnAsExpandedJson) ? showColumnAsExpandedJson : [showColumnAsExpandedJson];
4914
+ return rowJsonValues.map(parseExpandedJson);
4915
+ }, [showColumnAsExpandedJson]);
4916
+ const hasExpandableRows = react_exports.useMemo(
4917
+ () => expandedRowJson.some((rowJson) => rowJson.isExpandable),
4918
+ [expandedRowJson]
4919
+ );
4675
4920
  const TableHead = useTableHead(headerVisibility);
4676
4921
  const debouncedDrilldown = react_exports.useMemo(
4677
4922
  () => debounce_default((e, payload) => {
@@ -4759,7 +5004,7 @@ var PureTable = (props) => {
4759
5004
  );
4760
5005
  const handleResizeColumn = (_event, payload) => {
4761
5006
  setResizing(true);
4762
- const updatedCF = columns;
5007
+ const updatedCF = __spreadValues({}, columns);
4763
5008
  const field = payload.columnId;
4764
5009
  updatedCF[field] = __spreadProps(__spreadValues({}, updatedCF[field]), {
4765
5010
  width: Math.max(payload.width, MINIMUM_COLUMN_SIZE)
@@ -4782,6 +5027,15 @@ var PureTable = (props) => {
4782
5027
  const isFullyFixed = visibleHeaderCells.length === numberOfFixedHeaders;
4783
5028
  const isHeaderHidden = headerVisibility === "none";
4784
5029
  const onSortToUse = isResizing ? lodash_exports.noop : onSort;
5030
+ const handlePaginationSkipLink = (event) => {
5031
+ event.preventDefault();
5032
+ moveFocusInto(containerRef.current, '[data-test="table-pagination"]', event);
5033
+ };
5034
+ const handleTableSkipLink = (event) => {
5035
+ event.preventDefault();
5036
+ moveFocusOutside(containerRef.current, '[data-test="table-container"]', event);
5037
+ };
5038
+ const footerVisibleHeaderCells = tableHeader.cells.filter((c) => c.showCell !== false);
4785
5039
  const renderFooterRow = (key, dataAttr) => {
4786
5040
  const rows = ((tableFooter == null ? void 0 : tableFooter.rows) || []).filter((r) => r && r.key === key);
4787
5041
  if (rows.length === 0) return null;
@@ -4792,24 +5046,35 @@ var PureTable = (props) => {
4792
5046
  "data-test": dataAttr,
4793
5047
  "data-row-index": key === "footer-totals" ? "0" : "1"
4794
5048
  },
4795
- (row.cells || []).map((c, idx) => {
4796
- var _a2, _b2, _c2;
5049
+ (row.cells || []).filter((c) => c.showCell !== false).map((c, idx) => {
5050
+ var _a2, _b2, _c2, _d;
5051
+ const headerCell = footerVisibleHeaderCells[idx];
5052
+ const explicitWidth = headerCell && ((_a2 = columns[headerCell.value]) == null ? void 0 : _a2.width);
5053
+ const colWidth = explicitWidth && explicitWidth !== "auto" ? explicitWidth : void 0;
4797
5054
  return /* @__PURE__ */ react_exports.createElement(
4798
5055
  Table_default.Cell,
4799
5056
  {
4800
5057
  key: `${key}-cell-${c.key || idx}`,
4801
5058
  "data-test": "cell",
4802
- style: __spreadProps(__spreadValues({}, c.style), {
4803
- backgroundColor: ((_a2 = tableHeader.style) == null ? void 0 : _a2.backgroundColor) || ((_b2 = tableHeader.style) == null ? void 0 : _b2.color)
4804
- }),
5059
+ style: __spreadValues(__spreadProps(__spreadValues({}, c.style), {
5060
+ backgroundColor: ((_b2 = tableHeader.style) == null ? void 0 : _b2.backgroundColor) || ((_c2 = tableHeader.style) == null ? void 0 : _c2.color)
5061
+ }), colWidth !== void 0 && { width: colWidth }),
4805
5062
  align: c.align || "right"
4806
5063
  },
4807
- (_c2 = c.value) != null ? _c2 : ""
5064
+ (_d = c.value) != null ? _d : ""
4808
5065
  );
4809
5066
  })
4810
5067
  ));
4811
5068
  };
4812
- return /* @__PURE__ */ react_exports.createElement(VizTableContainer, { backgroundColor, ref: containerRef, "data-test": "table-container" }, /* @__PURE__ */ react_exports.createElement(
5069
+ return /* @__PURE__ */ react_exports.createElement(VizTableContainer, { backgroundColor, ref: containerRef, "data-test": "table-container" }, /* @__PURE__ */ react_exports.createElement("div", { "data-test": "skip-links-container" }, isPaging ? /* @__PURE__ */ react_exports.createElement(
5070
+ StyledSkipLink,
5071
+ {
5072
+ "data-test": "skip-link-pagination",
5073
+ to: "#pagination",
5074
+ onClick: handlePaginationSkipLink
5075
+ },
5076
+ (0, i18n_exports._)("Skip to table pagination")
5077
+ ) : null, /* @__PURE__ */ react_exports.createElement(StyledSkipLink, { "data-test": "skip-link-table", to: "#next", onClick: handleTableSkipLink }, (0, i18n_exports._)("Skip entire table"))), /* @__PURE__ */ react_exports.createElement(
4813
5078
  SUITableContainer,
4814
5079
  {
4815
5080
  ref: containerRefInner,
@@ -4827,6 +5092,7 @@ var PureTable = (props) => {
4827
5092
  {
4828
5093
  resizableFillLayout: true,
4829
5094
  headType: isHeaderHidden ? void 0 : "inline",
5095
+ rowExpansion: hasExpandableRows ? "multi" : "none",
4830
5096
  innerStyle: tableInnerStyle,
4831
5097
  outerStyle: tableOuterStyle,
4832
5098
  onClick: tableCellClickHandler,
@@ -4873,42 +5139,68 @@ var PureTable = (props) => {
4873
5139
  );
4874
5140
  }
4875
5141
  )),
4876
- /* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map(
4877
- (row) => /* @__PURE__ */ react_exports.createElement(Table_default.Row, { key: row.key }, row.cells.filter((c) => c.showCell).map((cell) => {
4878
- var _a2, _b2;
4879
- return /* @__PURE__ */ react_exports.createElement(SwitchTableCell, { key: cell.key, type: cell.cellType }, /* @__PURE__ */ react_exports.createElement(
4880
- TextCell,
4881
- {
4882
- cell,
4883
- useMouseOverEffect: getUseMouseOverEffect(
4884
- props,
4885
- cell.header
4886
- )
4887
- }
4888
- ), /* @__PURE__ */ react_exports.createElement(
4889
- SparklineCell,
4890
- {
4891
- cell,
4892
- useMouseOverEffect: getUseMouseOverEffect(
4893
- props,
4894
- cell.header
4895
- ),
4896
- width: (_b2 = (_a2 = columns[cell.header]) == null ? void 0 : _a2.width) != null ? _b2 : "auto"
4897
- }
4898
- ), /* @__PURE__ */ react_exports.createElement(
4899
- ArrayCell,
5142
+ /* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map((row) => {
5143
+ var _a2;
5144
+ const expandedRowData = expandedRowJson[row.index];
5145
+ const expandedJson = (_a2 = expandedRowData == null ? void 0 : expandedRowData.json) != null ? _a2 : null;
5146
+ const expandedRowColors = getExpandedRowColors(row);
5147
+ const expansionRow = (expandedRowData == null ? void 0 : expandedRowData.isExpandable) ? /* @__PURE__ */ react_exports.createElement(
5148
+ ExpandedContentRow,
5149
+ __spreadValues({
5150
+ key: `${row.key}-expanded`,
5151
+ "data-test": "expanded-json-row"
5152
+ }, expandedRowColors),
5153
+ /* @__PURE__ */ react_exports.createElement(Table_default.Cell, { colSpan: visibleHeaderCells.length }, /* @__PURE__ */ react_exports.createElement(ExpandedJsonTreeContainer, null, expandedJson === null ? null : /* @__PURE__ */ react_exports.createElement(
5154
+ JSONTree_default,
4900
5155
  {
4901
- cell,
4902
- useMouseOverEffect: getUseMouseOverEffect(
4903
- props,
4904
- cell.header
4905
- )
5156
+ json: expandedJson,
5157
+ defaultExpanded: true,
5158
+ overflow: "wrap"
4906
5159
  }
4907
- ));
4908
- }))
4909
- ), tableFooter && showFooterTotals && renderFooterRow("footer-totals", "footer-row-totals"), tableFooter && showFooterPercentages && renderFooterRow("footer-percentages", "footer-row-percentages"))
5160
+ )))
5161
+ ) : void 0;
5162
+ return /* @__PURE__ */ react_exports.createElement(
5163
+ ExpandableTableRow,
5164
+ __spreadValues({
5165
+ key: row.key,
5166
+ expansionRow
5167
+ }, expandedRowColors),
5168
+ row.cells.filter((c) => c.showCell).map((cell) => {
5169
+ var _a3, _b2;
5170
+ return /* @__PURE__ */ react_exports.createElement(SwitchTableCell, { key: cell.key, type: cell.cellType }, /* @__PURE__ */ react_exports.createElement(
5171
+ TextCell,
5172
+ {
5173
+ cell,
5174
+ useMouseOverEffect: getUseMouseOverEffect(
5175
+ props,
5176
+ cell.header
5177
+ )
5178
+ }
5179
+ ), /* @__PURE__ */ react_exports.createElement(
5180
+ SparklineCell,
5181
+ {
5182
+ cell,
5183
+ useMouseOverEffect: getUseMouseOverEffect(
5184
+ props,
5185
+ cell.header
5186
+ ),
5187
+ width: (_b2 = (_a3 = columns[cell.header]) == null ? void 0 : _a3.width) != null ? _b2 : "auto"
5188
+ }
5189
+ ), /* @__PURE__ */ react_exports.createElement(
5190
+ ArrayCell,
5191
+ {
5192
+ cell,
5193
+ useMouseOverEffect: getUseMouseOverEffect(
5194
+ props,
5195
+ cell.header
5196
+ )
5197
+ }
5198
+ ));
5199
+ })
5200
+ );
5201
+ }), tableFooter && showFooterTotals && renderFooterRow("footer-totals", "footer-row-totals"), tableFooter && showFooterPercentages && renderFooterRow("footer-percentages", "footer-row-percentages"))
4910
5202
  )
4911
- ), isPaging ? /* @__PURE__ */ react_exports.createElement(PaginatorContainer, null, width < COMPACT_PAGINATOR_WIDTH_THRESHOLD ? /* @__PURE__ */ react_exports.createElement(
5203
+ ), isPaging ? /* @__PURE__ */ react_exports.createElement(PaginatorContainer, { "data-test": "table-pagination" }, width < COMPACT_PAGINATOR_WIDTH_THRESHOLD ? /* @__PURE__ */ react_exports.createElement(
4912
5204
  Paginator_default.Compact,
4913
5205
  {
4914
5206
  current: paginatorProps.current,
@@ -4952,6 +5244,7 @@ PureTable.propTypes = {
4952
5244
  mode: prop_types_exports.string,
4953
5245
  onCellClick: prop_types_exports.func,
4954
5246
  paginatorParams: PaginatorParamsPropTypes,
5247
+ showColumnAsExpandedJson: prop_types_exports.arrayOf(prop_types_exports.string),
4955
5248
  showRowNumbers: prop_types_exports.bool,
4956
5249
  showFooterTotals: prop_types_exports.bool,
4957
5250
  sortParams: SortParamsPropTypes,
@@ -4986,6 +5279,7 @@ PureTable.defaultProps = {
4986
5279
  isPaging: false,
4987
5280
  onChange: lodash_exports.noop
4988
5281
  },
5282
+ showColumnAsExpandedJson: [],
4989
5283
  showRowNumbers: false,
4990
5284
  showFooterTotals: false,
4991
5285
  showFooterPercentages: false,
@@ -5036,9 +5330,9 @@ var computeVizProps = (_a) => {
5036
5330
  const handleColumnFormatChange = (updatedColumnFormat) => {
5037
5331
  var _a3;
5038
5332
  const cloneOfExistingColumnFormat = __spreadValues({}, ((_a3 = vizProps == null ? void 0 : vizProps.options) == null ? void 0 : _a3.columnFormat) || {});
5039
- const keys2 = Object.keys(updatedColumnFormat);
5333
+ const keys = Object.keys(updatedColumnFormat);
5040
5334
  const values = Object.values(updatedColumnFormat);
5041
- keys2.forEach((key, index) => {
5335
+ keys.forEach((key, index) => {
5042
5336
  if (!cloneOfExistingColumnFormat[key]) {
5043
5337
  cloneOfExistingColumnFormat[key] = {};
5044
5338
  }
@@ -5064,31 +5358,46 @@ var withTableFooter = (Viz) => {
5064
5358
  "dataSources",
5065
5359
  "options"
5066
5360
  ]);
5067
- var _a2;
5068
- if (!((_a2 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a2.data)) {
5069
- return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources, options }, otherProps));
5070
- }
5071
- const fieldsMeta = dataSources.primary.data.fields || [];
5072
- const footerData = buildFooterDataFrames(fieldsMeta);
5073
- let footerKey = `footer${(0, id_exports.createDOMID)().replace(/-/g, "")}`;
5074
- while (dataSources[footerKey]) {
5075
- footerKey = `footer${(0, id_exports.createDOMID)().replace(/-/g, "")}`;
5361
+ var _a2, _b2, _c;
5362
+ const footerKeyRef = react_exports.useRef(null);
5363
+ if (footerKeyRef.current === null) {
5364
+ let key = `footer${(0, id_exports.createDOMID)().replaceAll("-", "")}`;
5365
+ while (dataSources == null ? void 0 : dataSources[key]) {
5366
+ key = `footer${(0, id_exports.createDOMID)().replaceAll("-", "")}`;
5367
+ }
5368
+ footerKeyRef.current = key;
5076
5369
  }
5077
- const newDataSources = __spreadProps(__spreadValues({}, dataSources), {
5078
- [footerKey]: { data: footerData.footer }
5079
- });
5370
+ const footerKey = footerKeyRef.current;
5371
+ const fieldsMeta = react_exports.useMemo(
5372
+ () => {
5373
+ var _a3, _b3;
5374
+ return ((_b3 = (_a3 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a3.data) == null ? void 0 : _b3.fields) || [];
5375
+ },
5376
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5377
+ [JSON.stringify((_b2 = (_a2 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a2.data) == null ? void 0 : _b2.fields)]
5378
+ );
5379
+ const footerData = react_exports.useMemo(() => buildFooterDataFrames(fieldsMeta), [fieldsMeta]);
5380
+ const newDataSources = react_exports.useMemo(() => {
5381
+ var _a3;
5382
+ if (!((_a3 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a3.data)) return dataSources;
5383
+ return __spreadProps(__spreadValues({}, dataSources), {
5384
+ [footerKey]: { data: footerData.footer }
5385
+ });
5386
+ }, [dataSources, footerKey, footerData]);
5080
5387
  const showFooterTotals = Boolean(options == null ? void 0 : options.showFooterTotals);
5081
5388
  const showFooterPercentages = Boolean(options == null ? void 0 : options.showFooterPercentages);
5082
- let newOptions = options;
5083
- if (showFooterTotals || showFooterPercentages) {
5389
+ const newOptions = react_exports.useMemo(() => {
5390
+ if (!showFooterTotals && !showFooterPercentages) {
5391
+ return options;
5392
+ }
5084
5393
  const columnFormat = __spreadValues({}, (options == null ? void 0 : options.columnFormat) || {});
5085
5394
  const fieldNames = (fieldsMeta || []).map((f) => f && (f.name || f)).filter(Boolean);
5086
5395
  fieldNames.forEach((fieldName) => {
5087
- var _a3, _b2;
5396
+ var _a3, _b3;
5088
5397
  if (!fieldName || fieldName === "#") return;
5089
5398
  const existingFooter = (_a3 = columnFormat == null ? void 0 : columnFormat[fieldName]) == null ? void 0 : _a3.footer;
5090
5399
  if (typeof existingFooter === "undefined") {
5091
- const dataDsl = (_b2 = columnFormat == null ? void 0 : columnFormat[fieldName]) == null ? void 0 : _b2.data;
5400
+ const dataDsl = (_b3 = columnFormat == null ? void 0 : columnFormat[fieldName]) == null ? void 0 : _b3.data;
5092
5401
  let configToken = null;
5093
5402
  if (typeof dataDsl === "string") {
5094
5403
  const m = /formatByType\(([^)]+)\)/.exec(dataDsl);
@@ -5100,7 +5409,7 @@ var withTableFooter = (Viz) => {
5100
5409
  footer: footerDsl
5101
5410
  });
5102
5411
  } else if (typeof existingFooter === "string") {
5103
- const updatedFooterDsl = existingFooter.replace(/>\s*footer\b/g, `> ${footerKey}`);
5412
+ const updatedFooterDsl = existingFooter.replaceAll(/>\s*footer\w*/g, `> ${footerKey}`);
5104
5413
  if (updatedFooterDsl !== existingFooter) {
5105
5414
  columnFormat[fieldName] = __spreadProps(__spreadValues({}, columnFormat[fieldName] || {}), {
5106
5415
  footer: updatedFooterDsl
@@ -5108,7 +5417,10 @@ var withTableFooter = (Viz) => {
5108
5417
  }
5109
5418
  }
5110
5419
  });
5111
- newOptions = __spreadProps(__spreadValues({}, options || {}), { columnFormat });
5420
+ return __spreadProps(__spreadValues({}, options), { columnFormat });
5421
+ }, [options, fieldsMeta, showFooterTotals, showFooterPercentages, footerKey]);
5422
+ if (!((_c = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _c.data)) {
5423
+ return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources, options }, otherProps));
5112
5424
  }
5113
5425
  return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources: newDataSources, options: newOptions }, otherProps));
5114
5426
  };