@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.
- package/Area/Area.d.ts.map +1 -1
- package/Area/areaUtils.d.ts +1 -1
- package/Area/areaUtils.d.ts.map +1 -1
- package/Area/config.d.ts.map +1 -1
- package/Area.config.js +93 -25
- package/Area.config.js.map +3 -3
- package/Area.js +708 -319
- package/Area.js.map +4 -4
- package/Bar/Bar.d.ts.map +1 -1
- package/Bar.config.js +81 -24
- package/Bar.config.js.map +3 -3
- package/Bar.js +528 -297
- package/Bar.js.map +4 -4
- package/Bubble.config.js +80 -23
- package/Bubble.config.js.map +2 -2
- package/Bubble.js +375 -208
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +75 -60
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts +1 -0
- package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts +12 -25
- package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts.map +1 -1
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts +11 -4
- package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
- package/ChoroplethSvg.js +1133 -253
- package/ChoroplethSvg.js.map +4 -4
- package/Column/Column.d.ts.map +1 -1
- package/Column.config.js +81 -24
- package/Column.config.js.map +3 -3
- package/Column.js +531 -300
- package/Column.js.map +4 -4
- package/Ellipse.config.js +1 -1
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +277 -161
- package/Ellipse.js.map +4 -4
- package/Events/PureEvents/FieldSummaryTooltip.d.ts +8 -31
- package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
- package/Events/PureEvents/PureEvents.d.ts.map +1 -1
- package/Events/PureEvents/TimeControlsPopover.d.ts +6 -25
- package/Events/PureEvents/TimeControlsPopover.d.ts.map +1 -1
- package/Events/config.d.ts.map +1 -1
- package/Events.config.js +13 -3
- package/Events.config.js.map +2 -2
- package/Events.js +355 -293
- package/Events.js.map +4 -4
- package/FillerGauge/FillerGauge.d.ts.map +1 -1
- package/FillerGauge/config.d.ts.map +1 -1
- package/FillerGauge.config.js +76 -24
- package/FillerGauge.config.js.map +2 -2
- package/FillerGauge.js +512 -271
- package/FillerGauge.js.map +4 -4
- package/Image/config.d.ts.map +1 -1
- package/Image.config.js +7 -0
- package/Image.config.js.map +2 -2
- package/Image.js +282 -149
- package/Image.js.map +4 -4
- package/LICENSE +13 -0
- package/Line/Line.d.ts.map +1 -1
- package/Line/config.d.ts.map +1 -1
- package/Line/lineUtils.d.ts.map +1 -1
- package/Line/mockdata/LineData.d.ts +21 -0
- package/Line/mockdata/LineData.d.ts.map +1 -1
- package/Line.config.js +86 -25
- package/Line.config.js.map +3 -3
- package/Line.js +638 -382
- package/Line.js.map +4 -4
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +47 -73
- package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts +11 -2
- package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
- package/LinkGraph/PureLinkGraph/components/Graph.d.ts +5 -5
- package/LinkGraph/PureLinkGraph/components/Node.d.ts +2 -2
- package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +2 -2
- package/LinkGraph.js +886 -759
- package/LinkGraph.js.map +4 -4
- package/Map/Map.d.ts +1 -0
- package/Map/Map.d.ts.map +1 -1
- package/Map/PureMap/BubbleLayer.d.ts +22 -4
- package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/ChoroplethLayer.d.ts +9 -1
- package/Map/PureMap/ChoroplethLayer.d.ts.map +1 -1
- package/Map/PureMap/ClusterLayer.d.ts +3 -1
- package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
- package/Map/PureMap/LocalChoroplethLayer.d.ts +1 -0
- package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
- package/Map/PureMap/MapContext.d.ts +13 -0
- package/Map/PureMap/MapContext.d.ts.map +1 -0
- package/Map/PureMap/MarkerLayer.d.ts +19 -2
- package/Map/PureMap/MarkerLayer.d.ts.map +1 -1
- package/Map/PureMap/MarkerWrapper.d.ts +3 -2
- package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
- package/Map/PureMap/PureMap.d.ts +1 -0
- package/Map/PureMap/PureMap.d.ts.map +1 -1
- package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
- package/Map/PureMap/Tooltip.d.ts +6 -1
- package/Map/PureMap/Tooltip.d.ts.map +1 -1
- package/Map/PureMap/keyboardConstants.d.ts +11 -0
- package/Map/PureMap/keyboardConstants.d.ts.map +1 -0
- package/Map/PureMap/useRovingTabindex.d.ts +18 -0
- package/Map/PureMap/useRovingTabindex.d.ts.map +1 -0
- package/Map/config.d.ts.map +1 -1
- package/Map.config.js +4 -1
- package/Map.config.js.map +2 -2
- package/Map.js +1594 -628
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +304 -161
- package/Markdown.js.map +4 -4
- package/MarkerGauge/MarkerGauge.d.ts +1 -47
- package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +22 -68
- package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
- package/MarkerGauge/config.d.ts.map +1 -1
- package/MarkerGauge.config.js +75 -23
- package/MarkerGauge.config.js.map +2 -2
- package/MarkerGauge.js +560 -375
- package/MarkerGauge.js.map +4 -4
- package/NetworkGraph/NetworkGraph.d.ts +2 -5
- package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +1 -1
- package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +1 -0
- package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +23 -0
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js +2 -0
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +895 -455
- package/NetworkGraph.js.map +4 -4
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +288 -172
- package/ParallelCoordinates.js.map +4 -4
- package/Pie/Pie.d.ts.map +1 -1
- package/Pie/pieUtils.d.ts +2 -2
- package/Pie.config.js +74 -22
- package/Pie.config.js.map +2 -2
- package/Pie.js +522 -296
- package/Pie.js.map +4 -4
- package/ProcessTree/ProcessTree.d.ts +23 -0
- package/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +33 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts +8 -0
- package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +46 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts +20 -0
- package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts +20 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +46 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts +23 -0
- package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/mockdata/data.d.ts +235 -0
- package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +9 -0
- package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts +36 -0
- package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +82 -0
- package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -0
- package/ProcessTree/config.d.ts +4 -0
- package/ProcessTree/config.d.ts.map +1 -0
- package/ProcessTree/index.d.ts +3 -0
- package/ProcessTree/index.d.ts.map +1 -0
- package/ProcessTree.config.js +192 -0
- package/ProcessTree.config.js.map +7 -0
- package/ProcessTree.js +5128 -0
- package/ProcessTree.js.map +7 -0
- package/Punchcard/Punchcard.d.ts +1 -5
- package/Punchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/Punchcard.d.ts +28 -32
- package/Punchcard/PurePunchcard/Punchcard.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts +7 -12
- package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts +14 -19
- package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts +22 -27
- package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts +3 -8
- package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts +9 -14
- package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts.map +1 -1
- package/Punchcard/PurePunchcard/src/PunchcardRow.d.ts.map +1 -1
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +444 -631
- package/Punchcard.js.map +4 -4
- package/README.md +2 -0
- package/Rectangle.config.js +1 -1
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +289 -173
- package/Rectangle.js.map +4 -4
- package/RichText/PureRichText/Editor/EditorPanel.d.ts +20 -0
- package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts +17 -0
- package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/FontSelector.d.ts +15 -0
- package/RichText/PureRichText/Editor/FontSelector.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/FormatButton.d.ts +23 -0
- package/RichText/PureRichText/Editor/FormatButton.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/editorPanelUtils.d.ts +19 -0
- package/RichText/PureRichText/Editor/editorPanelUtils.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts +11 -0
- package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts +26 -0
- package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/Editor/index.d.ts +9 -0
- package/RichText/PureRichText/Editor/index.d.ts.map +1 -0
- package/RichText/PureRichText/InnerEditor.d.ts +41 -0
- package/RichText/PureRichText/InnerEditor.d.ts.map +1 -0
- package/RichText/PureRichText/PureRichText.d.ts +19 -0
- package/RichText/PureRichText/PureRichText.d.ts.map +1 -0
- package/RichText/PureRichText/PureRichTextContext.d.ts +64 -0
- package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -0
- package/RichText/PureRichText/RichTextStyles.d.ts +25 -0
- package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -0
- package/RichText/PureRichText/activeInstance.d.ts +23 -0
- package/RichText/PureRichText/activeInstance.d.ts.map +1 -0
- package/RichText/PureRichText/config.d.ts +17 -0
- package/RichText/PureRichText/config.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/index.d.ts +12 -0
- package/RichText/PureRichText/hooks/index.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useContentSave.d.ts +25 -0
- package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useContentSync.d.ts +28 -0
- package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts +33 -0
- package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useEditModeEffect.d.ts +10 -0
- package/RichText/PureRichText/hooks/useEditModeEffect.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts +36 -0
- package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +33 -0
- package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts +35 -0
- package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts +18 -0
- package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +24 -0
- package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useRichTextState.d.ts +38 -0
- package/RichText/PureRichText/hooks/useRichTextState.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts +17 -0
- package/RichText/PureRichText/hooks/useStepFontSize.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +18 -0
- package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -0
- package/RichText/PureRichText/hooks/useTokenMap.d.ts +45 -0
- package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -0
- package/RichText/PureRichText/index.d.ts +16 -0
- package/RichText/PureRichText/index.d.ts.map +1 -0
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts +8 -0
- package/RichText/PureRichText/renderers/ElementRenderer.d.ts.map +1 -0
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts +8 -0
- package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -0
- package/RichText/PureRichText/types.d.ts +111 -0
- package/RichText/PureRichText/types.d.ts.map +1 -0
- package/RichText/PureRichText/utils/a11yUtils.d.ts +9 -0
- package/RichText/PureRichText/utils/a11yUtils.d.ts.map +1 -0
- package/RichText/PureRichText/utils/fontSize.d.ts +6 -0
- package/RichText/PureRichText/utils/fontSize.d.ts.map +1 -0
- package/RichText/PureRichText/utils/slateUtils.d.ts +99 -0
- package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -0
- package/RichText/RichText.d.ts +17 -0
- package/RichText/RichText.d.ts.map +1 -0
- package/RichText/config.d.ts +4 -0
- package/RichText/config.d.ts.map +1 -0
- package/RichText/index.d.ts +7 -0
- package/RichText/index.d.ts.map +1 -0
- package/RichText.config.js +268 -0
- package/RichText.config.js.map +7 -0
- package/RichText.js +7674 -0
- package/RichText.js.map +7 -0
- package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyNode.d.ts +10 -3
- package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
- package/Sankey/PureSankey/SankeyUtils.d.ts +10 -0
- package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +562 -290
- package/Sankey.js.map +4 -4
- package/Scatter/Scatter.d.ts.map +1 -1
- package/Scatter.config.js +81 -24
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +528 -297
- package/Scatter.js.map +4 -4
- package/SingleValue/SingleValue.d.ts.map +1 -1
- package/SingleValue/config.d.ts.map +1 -1
- package/SingleValue.config.js +76 -24
- package/SingleValue.config.js.map +2 -2
- package/SingleValue.js +896 -779
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
- package/SingleValueIcon/config.d.ts.map +1 -1
- package/SingleValueIcon.config.js +76 -24
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +512 -287
- package/SingleValueIcon.js.map +4 -4
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
- package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
- package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
- package/SingleValueRadial/config.d.ts.map +1 -1
- package/SingleValueRadial.config.js +76 -24
- package/SingleValueRadial.config.js.map +2 -2
- package/SingleValueRadial.js +543 -326
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine/SparkLine.d.ts +57 -0
- package/SparkLine/SparkLine.d.ts.map +1 -0
- package/SparkLine/index.d.ts +1 -1
- package/SparkLine/index.d.ts.map +1 -1
- package/SparkLine.js +384 -485
- package/SparkLine.js.map +4 -4
- package/TRELLIS.md +48 -0
- package/Table/PureTable.d.ts +1 -0
- package/Table/PureTable.d.ts.map +1 -1
- package/Table/Table.d.ts.map +1 -1
- package/Table/cells/ArrayCell.d.ts.map +1 -1
- package/Table/config.d.ts.map +1 -1
- package/Table/hooks.d.ts +1 -1
- package/Table/hooks.d.ts.map +1 -1
- package/Table/tableUtils.d.ts +14 -0
- package/Table/tableUtils.d.ts.map +1 -0
- package/Table.config.js +4 -10
- package/Table.config.js.map +2 -2
- package/Table.js +1158 -846
- package/Table.js.map +4 -4
- package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +5 -0
- package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
- package/Timeline/Timeline.d.ts +2 -0
- package/Timeline/Timeline.d.ts.map +1 -1
- package/Timeline/config.d.ts.map +1 -1
- package/Timeline/mockdata/timelineDataSource.d.ts +34 -0
- package/Timeline/mockdata/timelineDataSource.d.ts.map +1 -1
- package/Timeline.config.js +15 -0
- package/Timeline.config.js.map +2 -2
- package/Timeline.js +348 -186
- package/Timeline.js.map +4 -4
- package/common/Charting.d.ts.map +1 -1
- package/common/Charting.js +50 -28
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.d.ts +1 -1
- package/common/ChartingApi.d.ts.map +1 -1
- package/common/ChartingApi.js.map +2 -2
- package/common/DocExampleWithVizSandbox.js.map +1 -1
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.d.ts +1 -1
- package/common/SplunkVisualization.d.ts.map +1 -1
- package/common/SplunkVisualization.js +6 -4
- package/common/SplunkVisualization.js.map +2 -2
- package/common/StyledSkipLink.d.ts +2 -0
- package/common/StyledSkipLink.d.ts.map +1 -0
- package/common/StyledSkipLink.js +81 -0
- package/common/StyledSkipLink.js.map +7 -0
- package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
- package/common/TimeSeriesChartWrapper.js +228 -107
- package/common/TimeSeriesChartWrapper.js.map +4 -4
- package/common/chartingUtils.d.ts +32 -6
- package/common/chartingUtils.d.ts.map +1 -1
- package/common/chartingUtils.js +166 -39
- package/common/chartingUtils.js.map +4 -4
- package/common/components/TrellisTitle.d.ts.map +1 -1
- package/common/docUtils.js +1 -1
- package/common/docUtils.js.map +2 -2
- package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
- package/common/editorConfig/AxesChartYGridAndLabels.d.ts.map +1 -1
- package/common/editorConfig/BackgroundColor.d.ts +2 -2
- package/common/editorConfig/TrellisEditors.d.ts +33 -5
- package/common/editorConfig/TrellisEditors.d.ts.map +1 -1
- package/common/hocs/mockdata/trellisData.d.ts +54 -0
- package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
- package/common/hocs/withTrellis.d.ts +9 -0
- package/common/hocs/withTrellis.d.ts.map +1 -1
- package/common/hooks/useSorting.d.ts +2 -2
- package/common/hooks/useSorting.d.ts.map +1 -1
- package/common/shapeUtils.d.ts +1 -1
- package/common/shapeUtils.d.ts.map +1 -1
- package/common/shapeUtils.js.map +2 -2
- package/common/utils/dataUtils.js +2 -1
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/focusUtils.d.ts +4 -0
- package/common/utils/focusUtils.d.ts.map +1 -0
- package/common/utils/focusUtils.js +101 -0
- package/common/utils/focusUtils.js.map +7 -0
- package/common/utils/mapUtils.js +513 -184
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/shadowDomUtils.d.ts +2 -0
- package/common/utils/shadowDomUtils.d.ts.map +1 -0
- package/common/utils/shadowDomUtils.js +39 -0
- package/common/utils/shadowDomUtils.js.map +7 -0
- package/common/utils/singleValueUtils.js +14 -26
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/trellisUtils.d.ts.map +1 -1
- package/common/utils/trellisUtils.js +76 -70
- package/common/utils/trellisUtils.js.map +2 -2
- package/common/withDashboardViz.d.ts.map +1 -1
- package/common/withDashboardViz.js +276 -151
- package/common/withDashboardViz.js.map +4 -4
- package/docs-llm/INDEX.md +118 -0
- package/docs-llm/area/examples-json.md +3854 -0
- package/docs-llm/area/examples-react.md +2816 -0
- package/docs-llm/area/options.md +97 -0
- package/docs-llm/area/overview.md +27 -0
- package/docs-llm/bar/examples-json.md +3380 -0
- package/docs-llm/bar/examples-react.md +2352 -0
- package/docs-llm/bar/options.md +89 -0
- package/docs-llm/bar/overview.md +25 -0
- package/docs-llm/bubble/examples-json.md +4082 -0
- package/docs-llm/bubble/examples-react.md +3977 -0
- package/docs-llm/bubble/options.md +62 -0
- package/docs-llm/bubble/overview.md +26 -0
- package/docs-llm/choropleth-svg/examples-json.md +397 -0
- package/docs-llm/choropleth-svg/examples-react.md +389 -0
- package/docs-llm/choropleth-svg/options.md +15 -0
- package/docs-llm/choropleth-svg/overview.md +23 -0
- package/docs-llm/column/examples-json.md +3898 -0
- package/docs-llm/column/examples-react.md +2653 -0
- package/docs-llm/column/options.md +94 -0
- package/docs-llm/column/overview.md +31 -0
- package/docs-llm/dsl/examples-json.md +43 -0
- package/docs-llm/dsl/examples-react.md +78 -0
- package/docs-llm/dsl/formatters/format-by-type-examples-json.md +58 -0
- package/docs-llm/dsl/formatters/format-by-type-examples-react.md +43 -0
- package/docs-llm/dsl/formatters/format-by-type.md +38 -0
- package/docs-llm/dsl/formatters/frame-examples-json.md +42 -0
- package/docs-llm/dsl/formatters/frame-examples-react.md +24 -0
- package/docs-llm/dsl/formatters/frame.md +6 -0
- package/docs-llm/dsl/formatters/gradient-examples-json.md +98 -0
- package/docs-llm/dsl/formatters/gradient-examples-react.md +44 -0
- package/docs-llm/dsl/formatters/gradient.md +23 -0
- package/docs-llm/dsl/formatters/lerp-examples-json.md +40 -0
- package/docs-llm/dsl/formatters/lerp-examples-react.md +28 -0
- package/docs-llm/dsl/formatters/lerp.md +19 -0
- package/docs-llm/dsl/formatters/match-value-examples-json.md +65 -0
- package/docs-llm/dsl/formatters/match-value-examples-react.md +37 -0
- package/docs-llm/dsl/formatters/match-value.md +13 -0
- package/docs-llm/dsl/formatters/max-contrast-examples-json.md +39 -0
- package/docs-llm/dsl/formatters/max-contrast-examples-react.md +27 -0
- package/docs-llm/dsl/formatters/max-contrast.md +9 -0
- package/docs-llm/dsl/formatters/multi-format-examples-json.md +67 -0
- package/docs-llm/dsl/formatters/multi-format-examples-react.md +49 -0
- package/docs-llm/dsl/formatters/multi-format.md +12 -0
- package/docs-llm/dsl/formatters/objects-examples-json.md +49 -0
- package/docs-llm/dsl/formatters/objects-examples-react.md +37 -0
- package/docs-llm/dsl/formatters/objects.md +3 -0
- package/docs-llm/dsl/formatters/pick-examples-json.md +59 -0
- package/docs-llm/dsl/formatters/pick-examples-react.md +30 -0
- package/docs-llm/dsl/formatters/pick.md +9 -0
- package/docs-llm/dsl/formatters/prefix-examples-json.md +29 -0
- package/docs-llm/dsl/formatters/prefix-examples-react.md +19 -0
- package/docs-llm/dsl/formatters/prefix.md +3 -0
- package/docs-llm/dsl/formatters/prepend-examples-json.md +51 -0
- package/docs-llm/dsl/formatters/prepend-examples-react.md +33 -0
- package/docs-llm/dsl/formatters/prepend.md +9 -0
- package/docs-llm/dsl/formatters/range-value-examples-json.md +48 -0
- package/docs-llm/dsl/formatters/range-value-examples-react.md +34 -0
- package/docs-llm/dsl/formatters/range-value.md +15 -0
- package/docs-llm/dsl/formatters/set-color-channel-examples-json.md +40 -0
- package/docs-llm/dsl/formatters/set-color-channel-examples-react.md +31 -0
- package/docs-llm/dsl/formatters/set-color-channel.md +9 -0
- package/docs-llm/dsl/formatters/suffix-examples-json.md +29 -0
- package/docs-llm/dsl/formatters/suffix-examples-react.md +19 -0
- package/docs-llm/dsl/formatters/suffix.md +3 -0
- package/docs-llm/dsl/formatters/type-examples-json.md +37 -0
- package/docs-llm/dsl/formatters/type-examples-react.md +20 -0
- package/docs-llm/dsl/formatters/type.md +3 -0
- package/docs-llm/dsl/overview.md +41 -0
- package/docs-llm/dsl/selectors/abs.md +7 -0
- package/docs-llm/dsl/selectors/ceil.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-average-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-average-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-average.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-count-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-count-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-count.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-examples-json.md +830 -0
- package/docs-llm/dsl/selectors/data-frame-examples-react.md +929 -0
- package/docs-llm/dsl/selectors/data-frame-get-field-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/data-frame-get-field-examples-react.md +124 -0
- package/docs-llm/dsl/selectors/data-frame-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-raw-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-get-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-max-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-max-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-max.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-min-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-min-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-min.md +7 -0
- package/docs-llm/dsl/selectors/data-frame-percentile-examples-json.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-percentile-examples-react.md +36 -0
- package/docs-llm/dsl/selectors/data-frame-percentile.md +8 -0
- package/docs-llm/dsl/selectors/data-frame-set-value.md +5 -0
- package/docs-llm/dsl/selectors/data-frame-sum-examples-json.md +51 -0
- package/docs-llm/dsl/selectors/data-frame-sum-examples-react.md +41 -0
- package/docs-llm/dsl/selectors/data-frame-sum.md +7 -0
- package/docs-llm/dsl/selectors/data-frame.md +4 -0
- package/docs-llm/dsl/selectors/data-point-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-point-get-raw-value.md +4 -0
- package/docs-llm/dsl/selectors/data-point-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-point-get-value.md +5 -0
- package/docs-llm/dsl/selectors/data-point-set-value.md +4 -0
- package/docs-llm/dsl/selectors/data-point.md +5 -0
- package/docs-llm/dsl/selectors/data-series-average.md +22 -0
- package/docs-llm/dsl/selectors/data-series-count.md +14 -0
- package/docs-llm/dsl/selectors/data-series-get-field.md +5 -0
- package/docs-llm/dsl/selectors/data-series-get-raw-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-get-type.md +5 -0
- package/docs-llm/dsl/selectors/data-series-get-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-max.md +5 -0
- package/docs-llm/dsl/selectors/data-series-min.md +5 -0
- package/docs-llm/dsl/selectors/data-series-percentile.md +17 -0
- package/docs-llm/dsl/selectors/data-series-set-value.md +4 -0
- package/docs-llm/dsl/selectors/data-series-sum.md +24 -0
- package/docs-llm/dsl/selectors/data-series.md +4 -0
- package/docs-llm/dsl/selectors/delta.md +7 -0
- package/docs-llm/dsl/selectors/divide.md +8 -0
- package/docs-llm/dsl/selectors/first-point.md +5 -0
- package/docs-llm/dsl/selectors/floor.md +7 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-index-range.md +10 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-json.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-react.md +87 -0
- package/docs-llm/dsl/selectors/frame-by-series-indexes.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-names.md +9 -0
- package/docs-llm/dsl/selectors/frame-by-series-types-examples-json.md +89 -0
- package/docs-llm/dsl/selectors/frame-by-series-types-examples-react.md +88 -0
- package/docs-llm/dsl/selectors/frame-by-series-types.md +9 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-json.md +137 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-react.md +135 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-json.md +157 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-react.md +155 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields-except.md +21 -0
- package/docs-llm/dsl/selectors/frame-without-internal-fields.md +17 -0
- package/docs-llm/dsl/selectors/frame-without-series-names.md +8 -0
- package/docs-llm/dsl/selectors/last-point.md +5 -0
- package/docs-llm/dsl/selectors/minus.md +8 -0
- package/docs-llm/dsl/selectors/multiply.md +8 -0
- package/docs-llm/dsl/selectors/plus.md +8 -0
- package/docs-llm/dsl/selectors/point-by-index.md +6 -0
- package/docs-llm/dsl/selectors/points-by-indexes.md +6 -0
- package/docs-llm/dsl/selectors/round.md +7 -0
- package/docs-llm/dsl/selectors/series-by-index-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-index-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-index.md +8 -0
- package/docs-llm/dsl/selectors/series-by-name-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-name-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-name.md +8 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-json.md +47 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-prioritized-types.md +10 -0
- package/docs-llm/dsl/selectors/series-by-type-examples-json.md +49 -0
- package/docs-llm/dsl/selectors/series-by-type-examples-react.md +39 -0
- package/docs-llm/dsl/selectors/series-by-type.md +10 -0
- package/docs-llm/dsl/selectors/series-by-types.md +6 -0
- package/docs-llm/ellipse/examples-json.md +5 -0
- package/docs-llm/ellipse/examples-react.md +5 -0
- package/docs-llm/ellipse/options.md +16 -0
- package/docs-llm/ellipse/overview.md +5 -0
- package/docs-llm/events/examples-json.md +705 -0
- package/docs-llm/events/examples-react.md +536 -0
- package/docs-llm/events/options.md +18 -0
- package/docs-llm/events/overview.md +5 -0
- package/docs-llm/filler-gauge/examples-json.md +376 -0
- package/docs-llm/filler-gauge/examples-react.md +274 -0
- package/docs-llm/filler-gauge/options.md +26 -0
- package/docs-llm/filler-gauge/overview.md +5 -0
- package/docs-llm/image/examples-json.md +39 -0
- package/docs-llm/image/examples-react.md +65 -0
- package/docs-llm/image/options.md +13 -0
- package/docs-llm/image/overview.md +5 -0
- package/docs-llm/line/examples-json.md +3724 -0
- package/docs-llm/line/examples-react.md +2683 -0
- package/docs-llm/line/options.md +95 -0
- package/docs-llm/line/overview.md +29 -0
- package/docs-llm/link-graph/examples-json.md +5 -0
- package/docs-llm/link-graph/examples-react.md +5 -0
- package/docs-llm/link-graph/options.md +26 -0
- package/docs-llm/link-graph/overview.md +16 -0
- package/docs-llm/map/examples-json.md +13973 -0
- package/docs-llm/map/examples-react.md +6154 -0
- package/docs-llm/map/options.md +22 -0
- package/docs-llm/map/overview.md +32 -0
- package/docs-llm/markdown/examples-json.md +63 -0
- package/docs-llm/markdown/examples-react.md +98 -0
- package/docs-llm/markdown/options.md +17 -0
- package/docs-llm/markdown/overview.md +5 -0
- package/docs-llm/marker-gauge/examples-json.md +436 -0
- package/docs-llm/marker-gauge/examples-react.md +367 -0
- package/docs-llm/marker-gauge/options.md +26 -0
- package/docs-llm/marker-gauge/overview.md +5 -0
- package/docs-llm/network-graph/examples-json.md +8843 -0
- package/docs-llm/network-graph/examples-react.md +7339 -0
- package/docs-llm/network-graph/options.md +50 -0
- package/docs-llm/network-graph/overview.md +28 -0
- package/docs-llm/parallel-coordinates/examples-json.md +8376 -0
- package/docs-llm/parallel-coordinates/examples-react.md +2771 -0
- package/docs-llm/parallel-coordinates/options.md +14 -0
- package/docs-llm/parallel-coordinates/overview.md +22 -0
- package/docs-llm/pie/examples-json.md +851 -0
- package/docs-llm/pie/examples-react.md +606 -0
- package/docs-llm/pie/options.md +34 -0
- package/docs-llm/pie/overview.md +23 -0
- package/docs-llm/process-tree/options.md +32 -0
- package/docs-llm/punchcard/examples-json.md +6134 -0
- package/docs-llm/punchcard/examples-react.md +4562 -0
- package/docs-llm/punchcard/options.md +33 -0
- package/docs-llm/punchcard/overview.md +5 -0
- package/docs-llm/pure-rich-text/options.md +28 -0
- package/docs-llm/rectangle/examples-json.md +5 -0
- package/docs-llm/rectangle/examples-react.md +5 -0
- package/docs-llm/rectangle/options.md +19 -0
- package/docs-llm/rectangle/overview.md +5 -0
- package/docs-llm/rich-text/examples-json.md +96 -0
- package/docs-llm/rich-text/examples-react.md +119 -0
- package/docs-llm/rich-text/options.md +28 -0
- package/docs-llm/rich-text/overview.md +5 -0
- package/docs-llm/sankey/examples-json.md +844 -0
- package/docs-llm/sankey/examples-react.md +546 -0
- package/docs-llm/sankey/options.md +19 -0
- package/docs-llm/sankey/overview.md +24 -0
- package/docs-llm/scatter/examples-json.md +4012 -0
- package/docs-llm/scatter/examples-react.md +3914 -0
- package/docs-llm/scatter/options.md +68 -0
- package/docs-llm/scatter/overview.md +25 -0
- package/docs-llm/single-value/examples-json.md +2613 -0
- package/docs-llm/single-value/examples-react.md +2296 -0
- package/docs-llm/single-value/options.md +49 -0
- package/docs-llm/single-value/overview.md +23 -0
- package/docs-llm/single-value-icon/examples-json.md +1686 -0
- package/docs-llm/single-value-icon/examples-react.md +1573 -0
- package/docs-llm/single-value-icon/options.md +43 -0
- package/docs-llm/single-value-icon/overview.md +5 -0
- package/docs-llm/single-value-radial/examples-json.md +1178 -0
- package/docs-llm/single-value-radial/examples-react.md +1028 -0
- package/docs-llm/single-value-radial/options.md +41 -0
- package/docs-llm/single-value-radial/overview.md +5 -0
- package/docs-llm/table/examples-json.md +5 -0
- package/docs-llm/table/examples-react.md +5 -0
- package/docs-llm/table/options.md +25 -0
- package/docs-llm/table/overview.md +24 -0
- package/docs-llm/timeline/examples-json.md +5 -0
- package/docs-llm/timeline/examples-react.md +5 -0
- package/docs-llm/timeline/options.md +27 -0
- package/docs-llm/timeline/overview.md +24 -0
- package/package.json +39 -30
- 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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
1095
|
-
const offset = requestParams
|
|
1096
|
-
const count = requestParams
|
|
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 = (
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
2064
|
+
} else if (nullValueMode != null) {
|
|
2027
2065
|
spanGaps = true;
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
}
|
|
2066
|
+
} else {
|
|
2067
|
+
spanGaps = void 0;
|
|
2031
2068
|
}
|
|
2032
|
-
|
|
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: {
|
|
2081
|
+
overrides: __spreadValues({
|
|
2082
|
+
width: shouldHideAreaOutline ? 0 : lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH
|
|
2083
|
+
}, isPercent ? { stacking: { mode: "percent", group: "A" } } : {})
|
|
2035
2084
|
};
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
if (y2Enabled)
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
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 =
|
|
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
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
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
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
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
|
-
() =>
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
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
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
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
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
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
|
|
3175
|
+
var defaultImport38 = __toESM(require("lodash/debounce"));
|
|
3058
3176
|
__reExport(debounce_exports, require("lodash/debounce"));
|
|
3059
|
-
var debounce_default = "default" in
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3151
|
-
|
|
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
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
3895
|
+
var Popover_default = "default" in defaultImport45 ? defaultImport45.default : defaultImport45;
|
|
3725
3896
|
|
|
3726
|
-
// src/SparkLine/SparkLine.
|
|
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
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
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
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
return
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
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
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
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
|
-
|
|
3800
|
-
case "End":
|
|
4094
|
+
} else if (event.key === "End") {
|
|
3801
4095
|
newIndex = numPoints - 1;
|
|
3802
|
-
|
|
3803
|
-
case "ArrowLeft":
|
|
4096
|
+
} else if (event.key === "ArrowLeft") {
|
|
3804
4097
|
newIndex = Math.max(0, activeIndex - 1);
|
|
3805
|
-
|
|
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
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
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
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
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
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
})
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
|
-
|
|
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 } =
|
|
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(
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
"
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
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(
|
|
4010
|
-
const
|
|
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":
|
|
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
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
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
|
-
|
|
4082
|
-
|
|
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
|
-
)),
|
|
4108
|
-
}
|
|
4109
|
-
getInteractionState
|
|
4110
|
-
|
|
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
|
|
4119
|
-
onKeyDown:
|
|
4120
|
-
onMouseOver:
|
|
4121
|
-
onMouseLeave:
|
|
4122
|
-
onFocus:
|
|
4123
|
-
onBlur:
|
|
4292
|
+
const interactiveProps2 = {
|
|
4293
|
+
onKeyDown: handleKeyDown,
|
|
4294
|
+
onMouseOver: handleMouseOver,
|
|
4295
|
+
onMouseLeave: handleMouseLeave,
|
|
4296
|
+
onFocus: handleFocus,
|
|
4297
|
+
onBlur: handleBlur
|
|
4124
4298
|
};
|
|
4125
|
-
const isHovered =
|
|
4126
|
-
const shouldDisplayInteractiveElements = (isHovered ||
|
|
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 ?
|
|
4309
|
+
const displayIndex = isHovered ? interactionHoveredIndex : interactionActiveIndex;
|
|
4136
4310
|
const isValidIndex = displayIndex !== null && displayIndex >= 0;
|
|
4137
|
-
const withinBounds = isValidIndex && displayIndex <
|
|
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 =
|
|
4147
|
-
const
|
|
4148
|
-
const
|
|
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:
|
|
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
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
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 (
|
|
4176
|
-
|
|
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:
|
|
4623
|
+
white-space: pre-wrap;
|
|
4624
|
+
text-overflow: clip;
|
|
4434
4625
|
display: inline;
|
|
4435
4626
|
`,
|
|
4436
|
-
|
|
4437
|
-
word-break:
|
|
4438
|
-
|
|
4439
|
-
white-space:
|
|
4440
|
-
|
|
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
|
-
|
|
4445
|
-
|
|
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
|
|
4499
|
-
&
|
|
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
|
|
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
|
|
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
|
-
|
|
4519
|
-
|
|
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: ((
|
|
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
|
-
(
|
|
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
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
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
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
cell.header
|
|
4905
|
-
)
|
|
5156
|
+
json: expandedJson,
|
|
5157
|
+
defaultExpanded: true,
|
|
5158
|
+
overflow: "wrap"
|
|
4906
5159
|
}
|
|
4907
|
-
))
|
|
4908
|
-
|
|
4909
|
-
|
|
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,
|
|
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
|
|
5333
|
+
const keys = Object.keys(updatedColumnFormat);
|
|
5040
5334
|
const values = Object.values(updatedColumnFormat);
|
|
5041
|
-
|
|
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
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
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
|
|
5078
|
-
|
|
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
|
-
|
|
5083
|
-
|
|
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,
|
|
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 = (
|
|
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.
|
|
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
|
-
|
|
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
|
};
|