@splunk/visualizations 28.5.2 → 28.6.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 -8
- 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/config.d.ts.map +1 -1
- package/Events.config.js +13 -3
- package/Events.config.js.map +2 -2
- package/Events.js +330 -194
- 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/PureMap/BubbleLayer.d.ts.map +1 -1
- package/Map/PureMap/Tooltip.d.ts.map +1 -1
- package/Map/config.d.ts.map +1 -1
- package/Map.config.js +4 -1
- package/Map.config.js.map +2 -2
- package/Map.js +296 -169
- package/Map.js.map +4 -4
- package/Markdown/Markdown.d.ts.map +1 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +283 -157
- 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 -1
- package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
- package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
- package/NetworkGraph.config.js.map +2 -2
- package/NetworkGraph.js +628 -434
- 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 +21 -0
- package/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +32 -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 +44 -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 +44 -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 +80 -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 +5058 -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/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 +534 -314
- 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/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.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 +769 -355
- 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 +2 -6
- package/common/utils/mapUtils.js.map +2 -2
- 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/package.json +32 -27
- 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";
|
|
@@ -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.6.0 - 92427899a"
|
|
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.6.0 - 92427899a",
|
|
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);
|
|
@@ -3414,13 +3541,134 @@ var validValueSelector = (v1, v2, v3, defaultValue) => {
|
|
|
3414
3541
|
}
|
|
3415
3542
|
return defaultValue;
|
|
3416
3543
|
};
|
|
3544
|
+
var computeBodyRows = (args) => {
|
|
3545
|
+
const rows = [];
|
|
3546
|
+
const {
|
|
3547
|
+
table: t,
|
|
3548
|
+
tableHeader: hdr,
|
|
3549
|
+
columnFormat: cfmt,
|
|
3550
|
+
tableFormat: tfmt,
|
|
3551
|
+
columnIds: cids,
|
|
3552
|
+
showInternalFields: showInternal,
|
|
3553
|
+
longestColumnLength: len,
|
|
3554
|
+
themeFunc: themeFn
|
|
3555
|
+
} = args;
|
|
3556
|
+
for (let r = 0; r < len; r += 1) {
|
|
3557
|
+
const row = { key: `row-${r}`, index: r, cells: [] };
|
|
3558
|
+
t.forEach((column, i) => {
|
|
3559
|
+
const currentHeader = hdr.cells[i];
|
|
3560
|
+
const value = validValueSelector(
|
|
3561
|
+
getColumnFormatData(cfmt, currentHeader, r),
|
|
3562
|
+
getTableFormatData(tfmt, i, r),
|
|
3563
|
+
column[r],
|
|
3564
|
+
""
|
|
3565
|
+
);
|
|
3566
|
+
const rawValue = column[r];
|
|
3567
|
+
const rowBackgroundColor = getColumnFormatRowBgColor(cfmt, currentHeader, r) || getTableFormatRowBgColor(tfmt, i, r) || getThemeRowBgColor(themeFn, r);
|
|
3568
|
+
const rowColor = getColumnFormatRowColor(cfmt, currentHeader, r) || getTableFormatRowColor(tfmt, i, r) || getThemeRowColor(themeFn);
|
|
3569
|
+
const align = getColumnFormatAlign(cfmt, currentHeader, r) || getTableFormatAlign(tfmt, i, r) || "left";
|
|
3570
|
+
const cellType = getColumnFormatCellType(cfmt, currentHeader, r) || getTableFormatCellType(tfmt, i, r) || "TextCell";
|
|
3571
|
+
const sparklineColor = getColumnFormatSparklineColor(cfmt, currentHeader, r) || getTableFormatSparklineColor(tfmt, i, r) || void 0;
|
|
3572
|
+
const sparklineAreaColor = getColumnFormatSparklineAreaColor(cfmt, currentHeader, r) || getTableFormatSparklineAreaColor(tfmt, i, r) || void 0;
|
|
3573
|
+
const sparklineType = getColumnFormatSparklineType(cfmt, currentHeader, r) || getTableFormatSparklineType(tfmt, i, r) || "area";
|
|
3574
|
+
const sparklineNullValueDisplay = getColumnFormatSparklineNullValueDisplay(cfmt, currentHeader) || getTableFormatSparklineNullValueDisplay(tfmt) || "gaps";
|
|
3575
|
+
const key = generateKey(value, `${r}-${i}`);
|
|
3576
|
+
const textOverflowType = getTextOverflowType(cfmt, cids[i], tfmt, currentHeader.value);
|
|
3577
|
+
const textOverflowStyle = getOverflowStyles({
|
|
3578
|
+
textOverflow: textOverflowType
|
|
3579
|
+
});
|
|
3580
|
+
const showCell = !(!showInternal && currentHeader.value.startsWith("_") && currentHeader.value !== "_time");
|
|
3581
|
+
row.cells.push({
|
|
3582
|
+
key,
|
|
3583
|
+
value,
|
|
3584
|
+
rawValue,
|
|
3585
|
+
align,
|
|
3586
|
+
cellType,
|
|
3587
|
+
rowIndex: r,
|
|
3588
|
+
columnIndex: i,
|
|
3589
|
+
sparklineColor,
|
|
3590
|
+
sparklineAreaColor,
|
|
3591
|
+
sparklineType,
|
|
3592
|
+
sparklineNullValueDisplay,
|
|
3593
|
+
header: currentHeader.value,
|
|
3594
|
+
style: __spreadValues({
|
|
3595
|
+
backgroundColor: rowBackgroundColor,
|
|
3596
|
+
color: rowColor
|
|
3597
|
+
}, textOverflowStyle),
|
|
3598
|
+
showCell
|
|
3599
|
+
});
|
|
3600
|
+
});
|
|
3601
|
+
rows.push(row);
|
|
3602
|
+
}
|
|
3603
|
+
return rows;
|
|
3604
|
+
};
|
|
3605
|
+
var prependRowNumberColumn = (table, headers, columnIds, tableFormat, longestColumnLength, paginationOffset, count) => {
|
|
3606
|
+
const correctedPaginationOffset = Math.max(0, (paginationOffset - 1) * count);
|
|
3607
|
+
const newHeaders = ["#", ...headers];
|
|
3608
|
+
const newColumnIds = ["#", ...columnIds];
|
|
3609
|
+
const newTable = [
|
|
3610
|
+
Array.from({ length: longestColumnLength }, (v, i) => correctedPaginationOffset + i + 1),
|
|
3611
|
+
...table
|
|
3612
|
+
];
|
|
3613
|
+
const newTableFormat = __spreadValues({}, tableFormat);
|
|
3614
|
+
if (isArray2(newTableFormat.align)) {
|
|
3615
|
+
newTableFormat.align = [
|
|
3616
|
+
new Array(longestColumnLength).fill("left"),
|
|
3617
|
+
...newTableFormat.align
|
|
3618
|
+
];
|
|
3619
|
+
}
|
|
3620
|
+
if (isArray2(newTableFormat.cellTypes)) {
|
|
3621
|
+
newTableFormat.cellTypes = [
|
|
3622
|
+
new Array(longestColumnLength).fill("TextCell"),
|
|
3623
|
+
...newTableFormat.cellTypes
|
|
3624
|
+
];
|
|
3625
|
+
}
|
|
3626
|
+
if (isArray2(newTableFormat.data)) {
|
|
3627
|
+
newTableFormat.data = [
|
|
3628
|
+
Array.from({ length: longestColumnLength }, (v, i) => `${i + 1}`),
|
|
3629
|
+
...newTableFormat.data
|
|
3630
|
+
];
|
|
3631
|
+
}
|
|
3632
|
+
if (isArray2(newTableFormat.rowBackgroundColors)) {
|
|
3633
|
+
if (newTableFormat.rowBackgroundColors.length > 0 && isArray2(newTableFormat.rowBackgroundColors[0])) {
|
|
3634
|
+
newTableFormat.rowBackgroundColors = [
|
|
3635
|
+
new Array(longestColumnLength),
|
|
3636
|
+
...newTableFormat.rowBackgroundColors
|
|
3637
|
+
];
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
if (isArray2(newTableFormat.rowColors)) {
|
|
3641
|
+
if (newTableFormat.rowColors.length > 0 && isArray2(newTableFormat.rowColors[0])) {
|
|
3642
|
+
newTableFormat.rowColors = [
|
|
3643
|
+
new Array(longestColumnLength),
|
|
3644
|
+
...newTableFormat.rowColors
|
|
3645
|
+
];
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
if (isArray2(newTableFormat.sparklineColors)) {
|
|
3649
|
+
newTableFormat.sparklineColors = [new Array(longestColumnLength), ...newTableFormat.sparklineColors];
|
|
3650
|
+
}
|
|
3651
|
+
if (isArray2(newTableFormat.sparklineAreaColors)) {
|
|
3652
|
+
newTableFormat.sparklineAreaColors = [
|
|
3653
|
+
new Array(longestColumnLength),
|
|
3654
|
+
...newTableFormat.sparklineAreaColors
|
|
3655
|
+
];
|
|
3656
|
+
}
|
|
3657
|
+
if (isArray2(newTableFormat.sparklineTypes)) {
|
|
3658
|
+
newTableFormat.sparklineTypes = [
|
|
3659
|
+
new Array(longestColumnLength).fill("area"),
|
|
3660
|
+
...newTableFormat.sparklineTypes
|
|
3661
|
+
];
|
|
3662
|
+
}
|
|
3663
|
+
return { table: newTable, headers: newHeaders, columnIds: newColumnIds, tableFormat: newTableFormat };
|
|
3664
|
+
};
|
|
3417
3665
|
var useTable = (tableArgs = {}) => {
|
|
3418
3666
|
let { table = [], headers = [], columnIds = [] } = tableArgs;
|
|
3419
3667
|
const {
|
|
3420
3668
|
headerVisibility = "inline",
|
|
3421
3669
|
showRowNumbers = false,
|
|
3422
3670
|
showInternalFields = true,
|
|
3423
|
-
tableFormat = {},
|
|
3671
|
+
tableFormat: tableFormatIn = {},
|
|
3424
3672
|
columnFormat = {},
|
|
3425
3673
|
paginationOffset = 0,
|
|
3426
3674
|
count = 0,
|
|
@@ -3428,64 +3676,18 @@ var useTable = (tableArgs = {}) => {
|
|
|
3428
3676
|
showFooterPercentages = false,
|
|
3429
3677
|
themeFunc
|
|
3430
3678
|
} = tableArgs;
|
|
3679
|
+
let tableFormat = tableFormatIn;
|
|
3431
3680
|
const longestColumnLength = Math.max(...table.map((column) => column.length));
|
|
3432
3681
|
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
|
-
}
|
|
3682
|
+
({ table, headers, columnIds, tableFormat } = prependRowNumberColumn(
|
|
3683
|
+
table,
|
|
3684
|
+
headers,
|
|
3685
|
+
columnIds,
|
|
3686
|
+
tableFormat,
|
|
3687
|
+
longestColumnLength,
|
|
3688
|
+
paginationOffset,
|
|
3689
|
+
count
|
|
3690
|
+
));
|
|
3489
3691
|
}
|
|
3490
3692
|
const tableHeader = {
|
|
3491
3693
|
visibility: visualization_schemas_exports.validHeaderVisibilities.indexOf(headerVisibility) >= 0 ? headerVisibility : "inline",
|
|
@@ -3511,67 +3713,6 @@ var useTable = (tableArgs = {}) => {
|
|
|
3511
3713
|
const tableFooter = {
|
|
3512
3714
|
rows: []
|
|
3513
3715
|
};
|
|
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
3716
|
tableBody.rows = computeBodyRows({
|
|
3576
3717
|
table,
|
|
3577
3718
|
tableHeader,
|
|
@@ -3615,6 +3756,7 @@ var useTable = (tableArgs = {}) => {
|
|
|
3615
3756
|
key: `${key}-${colIdx}`,
|
|
3616
3757
|
value: displayValue,
|
|
3617
3758
|
align: derivedAlign,
|
|
3759
|
+
showCell: colMeta.showCell,
|
|
3618
3760
|
style: __spreadValues(__spreadValues({
|
|
3619
3761
|
backgroundColor: ((_f = tableHeader.style) == null ? void 0 : _f.backgroundColor) || ((_g = tableHeader.style) == null ? void 0 : _g.color),
|
|
3620
3762
|
color: (_h = tableHeader.style) == null ? void 0 : _h.color
|
|
@@ -3638,6 +3780,38 @@ var useTable = (tableArgs = {}) => {
|
|
|
3638
3780
|
};
|
|
3639
3781
|
};
|
|
3640
3782
|
|
|
3783
|
+
// esm-externals:@splunk/react-ui/Link
|
|
3784
|
+
var Link_exports = {};
|
|
3785
|
+
__export(Link_exports, {
|
|
3786
|
+
default: () => Link_default
|
|
3787
|
+
});
|
|
3788
|
+
var defaultImport43 = __toESM(require("@splunk/react-ui/Link"));
|
|
3789
|
+
__reExport(Link_exports, require("@splunk/react-ui/Link"));
|
|
3790
|
+
var Link_default = "default" in defaultImport43 ? defaultImport43.default : defaultImport43;
|
|
3791
|
+
|
|
3792
|
+
// esm-externals:@splunk/themes
|
|
3793
|
+
var themes_exports = {};
|
|
3794
|
+
__export(themes_exports, {
|
|
3795
|
+
default: () => themes_default
|
|
3796
|
+
});
|
|
3797
|
+
var defaultImport44 = __toESM(require("@splunk/themes"));
|
|
3798
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
3799
|
+
var themes_default = "default" in defaultImport44 ? defaultImport44.default : defaultImport44;
|
|
3800
|
+
|
|
3801
|
+
// src/common/StyledSkipLink.tsx
|
|
3802
|
+
var StyledSkipLink = styled_components_default(Link_default)`
|
|
3803
|
+
${themes_exports.mixins.skipLink()};
|
|
3804
|
+
&:not([disabled], [aria-disabled='true']) {
|
|
3805
|
+
background-color: ${themes_exports.variables.backgroundColorSection};
|
|
3806
|
+
}
|
|
3807
|
+
&&& {
|
|
3808
|
+
text-decoration: none;
|
|
3809
|
+
}
|
|
3810
|
+
&:focus {
|
|
3811
|
+
z-index: ${themes_exports.variables.zindexLayer};
|
|
3812
|
+
}
|
|
3813
|
+
`;
|
|
3814
|
+
|
|
3641
3815
|
// src/Table/cells/SwitchTableCell.tsx
|
|
3642
3816
|
var SwitchTableCell = ({ type, children }) => children.filter((child) => child.type.displayName === type);
|
|
3643
3817
|
|
|
@@ -3685,9 +3859,20 @@ var ArrayCell = ({ cell, useMouseOverEffect }) => {
|
|
|
3685
3859
|
const _a = style, { whiteSpace, overflow, textOverflow, wordBreak, wordWrap, overflowWrap } = _a, rest = __objRest(_a, ["whiteSpace", "overflow", "textOverflow", "wordBreak", "wordWrap", "overflowWrap"]);
|
|
3686
3860
|
return {
|
|
3687
3861
|
cellStyle: rest,
|
|
3688
|
-
|
|
3862
|
+
// flex-direction:column (set on StyledTableCell) makes justify-content control the
|
|
3863
|
+
// vertical axis, so the Cell's `align` prop no longer drives horizontal alignment.
|
|
3864
|
+
// Explicitly mirror cell.align as textAlign on each item to restore the behaviour.
|
|
3865
|
+
itemStyle: {
|
|
3866
|
+
whiteSpace,
|
|
3867
|
+
overflow,
|
|
3868
|
+
textOverflow,
|
|
3869
|
+
wordBreak,
|
|
3870
|
+
wordWrap,
|
|
3871
|
+
overflowWrap,
|
|
3872
|
+
textAlign: cell.align
|
|
3873
|
+
}
|
|
3689
3874
|
};
|
|
3690
|
-
}, [cell.style]);
|
|
3875
|
+
}, [cell.style, cell.align]);
|
|
3691
3876
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3692
3877
|
StyledTableCell,
|
|
3693
3878
|
{
|
|
@@ -3719,9 +3904,9 @@ var Popover_exports = {};
|
|
|
3719
3904
|
__export(Popover_exports, {
|
|
3720
3905
|
default: () => Popover_default
|
|
3721
3906
|
});
|
|
3722
|
-
var
|
|
3907
|
+
var defaultImport45 = __toESM(require("@splunk/react-ui/Popover"));
|
|
3723
3908
|
__reExport(Popover_exports, require("@splunk/react-ui/Popover"));
|
|
3724
|
-
var Popover_default = "default" in
|
|
3909
|
+
var Popover_default = "default" in defaultImport45 ? defaultImport45.default : defaultImport45;
|
|
3725
3910
|
|
|
3726
3911
|
// src/SparkLine/SparkLine.jsx
|
|
3727
3912
|
var StyledSvg = styled_components_default.svg`
|
|
@@ -4405,6 +4590,128 @@ SparklineCell.displayName = "SparklineCell";
|
|
|
4405
4590
|
// src/common/utils/textUtils.ts
|
|
4406
4591
|
var VIZ_FONT_FAMILY = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
4407
4592
|
|
|
4593
|
+
// src/common/utils/focusUtils.ts
|
|
4594
|
+
var DEFAULT_FOCUSABLE_SELECTORS = [
|
|
4595
|
+
"a[href]",
|
|
4596
|
+
"button:not([disabled])",
|
|
4597
|
+
"input:not([disabled])",
|
|
4598
|
+
"select:not([disabled])",
|
|
4599
|
+
"textarea:not([disabled])",
|
|
4600
|
+
"[tabindex]:not([disabled]):not([hidden])",
|
|
4601
|
+
"area[href]",
|
|
4602
|
+
"iframe",
|
|
4603
|
+
"object",
|
|
4604
|
+
"embed",
|
|
4605
|
+
'[contenteditable]:not([contenteditable="false"])',
|
|
4606
|
+
"summary",
|
|
4607
|
+
"audio[controls]",
|
|
4608
|
+
"video[controls]"
|
|
4609
|
+
].join(",");
|
|
4610
|
+
var getFocusableElements = () => {
|
|
4611
|
+
return Array.from(document.querySelectorAll(DEFAULT_FOCUSABLE_SELECTORS));
|
|
4612
|
+
};
|
|
4613
|
+
var isElementHidden = (element) => {
|
|
4614
|
+
const computedStyle = window.getComputedStyle(element);
|
|
4615
|
+
return element.hasAttribute("hidden") || element.getAttribute("aria-hidden") === "true" || computedStyle.display === "none" || computedStyle.visibility === "hidden";
|
|
4616
|
+
};
|
|
4617
|
+
var isVisibleFocusableElement = (element) => {
|
|
4618
|
+
let currentElement = element;
|
|
4619
|
+
while (currentElement) {
|
|
4620
|
+
if (isElementHidden(currentElement)) {
|
|
4621
|
+
return false;
|
|
4622
|
+
}
|
|
4623
|
+
currentElement = currentElement.parentElement;
|
|
4624
|
+
}
|
|
4625
|
+
return true;
|
|
4626
|
+
};
|
|
4627
|
+
var resolveTargetElement = (container, selector) => {
|
|
4628
|
+
if (container instanceof Element && container.matches(selector)) {
|
|
4629
|
+
return container;
|
|
4630
|
+
}
|
|
4631
|
+
return container.querySelector(selector);
|
|
4632
|
+
};
|
|
4633
|
+
var findFirstFocusableElementAfter = (container, selector) => {
|
|
4634
|
+
const targetElement = resolveTargetElement(container, selector);
|
|
4635
|
+
if (!targetElement) {
|
|
4636
|
+
return null;
|
|
4637
|
+
}
|
|
4638
|
+
return getFocusableElements().find((element) => {
|
|
4639
|
+
if (targetElement.contains(element)) {
|
|
4640
|
+
return false;
|
|
4641
|
+
}
|
|
4642
|
+
const relativePosition = targetElement.compareDocumentPosition(element);
|
|
4643
|
+
return relativePosition === Node.DOCUMENT_POSITION_FOLLOWING && isVisibleFocusableElement(element);
|
|
4644
|
+
}) || null;
|
|
4645
|
+
};
|
|
4646
|
+
var findFirstFocusableElementInside = (container, selector) => {
|
|
4647
|
+
const targetElement = resolveTargetElement(container, selector);
|
|
4648
|
+
if (!targetElement) {
|
|
4649
|
+
return null;
|
|
4650
|
+
}
|
|
4651
|
+
return getFocusableElements().find((element) => {
|
|
4652
|
+
return element !== targetElement && targetElement.contains(element) && isVisibleFocusableElement(element);
|
|
4653
|
+
}) || null;
|
|
4654
|
+
};
|
|
4655
|
+
var moveFocusOutside = (container, selector, event) => {
|
|
4656
|
+
var _a;
|
|
4657
|
+
event.preventDefault();
|
|
4658
|
+
(_a = findFirstFocusableElementAfter(container, selector)) == null ? void 0 : _a.focus();
|
|
4659
|
+
};
|
|
4660
|
+
var moveFocusInto = (container, selector, event) => {
|
|
4661
|
+
var _a;
|
|
4662
|
+
event.preventDefault();
|
|
4663
|
+
(_a = findFirstFocusableElementInside(container, selector)) == null ? void 0 : _a.focus();
|
|
4664
|
+
};
|
|
4665
|
+
|
|
4666
|
+
// src/Table/tableUtils.ts
|
|
4667
|
+
var isJSONObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.values(value).every(isJSONElement);
|
|
4668
|
+
var isJSONTreeContent = (value) => Array.isArray(value) && value.every(isJSONElement) || isJSONObject(value);
|
|
4669
|
+
var isJSONElement = (value) => {
|
|
4670
|
+
if (value === void 0 || value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
4671
|
+
return true;
|
|
4672
|
+
}
|
|
4673
|
+
if (Array.isArray(value)) {
|
|
4674
|
+
return value.every(isJSONElement);
|
|
4675
|
+
}
|
|
4676
|
+
if (typeof value === "object") {
|
|
4677
|
+
return Object.values(value).every(isJSONElement);
|
|
4678
|
+
}
|
|
4679
|
+
return false;
|
|
4680
|
+
};
|
|
4681
|
+
var parseExpandedJson = (value) => {
|
|
4682
|
+
if (value === void 0 || value === null || value === "") {
|
|
4683
|
+
return { isExpandable: true, json: null };
|
|
4684
|
+
}
|
|
4685
|
+
if (typeof value !== "string") {
|
|
4686
|
+
return { isExpandable: true, json: null };
|
|
4687
|
+
}
|
|
4688
|
+
try {
|
|
4689
|
+
const parsedValue = JSON.parse(value);
|
|
4690
|
+
return {
|
|
4691
|
+
isExpandable: true,
|
|
4692
|
+
json: isJSONTreeContent(parsedValue) ? parsedValue : null
|
|
4693
|
+
};
|
|
4694
|
+
} catch (e) {
|
|
4695
|
+
return { isExpandable: true, json: null };
|
|
4696
|
+
}
|
|
4697
|
+
};
|
|
4698
|
+
var getExpandedRowColors = (row) => {
|
|
4699
|
+
var _a, _b, _c, _d;
|
|
4700
|
+
const visibleCells = row.cells.filter((cell) => cell.showCell);
|
|
4701
|
+
const backgroundColor = (_b = (_a = visibleCells.find((cell) => {
|
|
4702
|
+
var _a2;
|
|
4703
|
+
return (_a2 = cell.style) == null ? void 0 : _a2.backgroundColor;
|
|
4704
|
+
})) == null ? void 0 : _a.style) == null ? void 0 : _b.backgroundColor;
|
|
4705
|
+
const color = (_d = (_c = visibleCells.find((cell) => {
|
|
4706
|
+
var _a2;
|
|
4707
|
+
return (_a2 = cell.style) == null ? void 0 : _a2.color;
|
|
4708
|
+
})) == null ? void 0 : _c.style) == null ? void 0 : _d.color;
|
|
4709
|
+
return {
|
|
4710
|
+
backgroundColor,
|
|
4711
|
+
color
|
|
4712
|
+
};
|
|
4713
|
+
};
|
|
4714
|
+
|
|
4408
4715
|
// src/Table/PureTable.tsx
|
|
4409
4716
|
var MINIMUM_COLUMN_SIZE = 60;
|
|
4410
4717
|
var INITIAL_UNSET_COLUMN_WIDTH = 90;
|
|
@@ -4495,28 +4802,32 @@ var SUITableContainer = styled_components_default.div`
|
|
|
4495
4802
|
margin-bottom: ${PAGINATOR_SPACING}px;
|
|
4496
4803
|
`};
|
|
4497
4804
|
|
|
4498
|
-
${({ headerStyle }) => headerStyle
|
|
4499
|
-
&
|
|
4805
|
+
${({ headerStyle }) => (headerStyle == null ? void 0 : headerStyle.backgroundColor) && styled_components_exports.css`
|
|
4806
|
+
& th {
|
|
4500
4807
|
background-color: ${headerStyle.backgroundColor};
|
|
4501
4808
|
}
|
|
4502
4809
|
`}
|
|
4503
4810
|
|
|
4504
|
-
${({ headerStyle }) => headerStyle
|
|
4811
|
+
${({ headerStyle }) => (headerStyle == null ? void 0 : headerStyle.color) && styled_components_exports.css`
|
|
4505
4812
|
& [data-test='head-cell'] > div > button > span {
|
|
4506
4813
|
color: ${headerStyle.color};
|
|
4507
4814
|
}
|
|
4508
4815
|
`}
|
|
4509
4816
|
|
|
4510
4817
|
/* Footer cells should match header background for both totals and percentages */
|
|
4511
|
-
${({ headerStyle }) => headerStyle
|
|
4818
|
+
${({ headerStyle }) => ((headerStyle == null ? void 0 : headerStyle.backgroundColor) || (headerStyle == null ? void 0 : headerStyle.color)) && styled_components_exports.css`
|
|
4512
4819
|
tr[data-test='footer-row-totals'] td[data-test='cell'],
|
|
4513
4820
|
tr[data-test='footer-row-percentages'] td[data-test='cell'] {
|
|
4514
4821
|
background-color: ${headerStyle.backgroundColor || headerStyle.color} !important;
|
|
4515
4822
|
}
|
|
4516
4823
|
`}
|
|
4517
4824
|
|
|
4518
|
-
|
|
4519
|
-
|
|
4825
|
+
tbody tr td[data-test='expand'] button {
|
|
4826
|
+
background-color: transparent !important;
|
|
4827
|
+
}
|
|
4828
|
+
|
|
4829
|
+
/* To accomodate custom logic that diverges from default resizableFillLayout behavior - allows the columns to shrink beneath Table width when columns are fixed */
|
|
4830
|
+
[data-test='main-table'] {
|
|
4520
4831
|
${({ isFullyFixed }) => isFullyFixed && styled_components_exports.css`
|
|
4521
4832
|
width: fit-content;
|
|
4522
4833
|
min-width: unset;
|
|
@@ -4533,6 +4844,33 @@ var PaginatorContainer = styled_components_default.div`
|
|
|
4533
4844
|
height: ${PAGINATOR_CONTAINER_HEIGHT}px;
|
|
4534
4845
|
`;
|
|
4535
4846
|
PaginatorContainer.displayName = "PaginatorContainer";
|
|
4847
|
+
var ExpandedJsonTreeContainer = styled_components_default.div`
|
|
4848
|
+
& * {
|
|
4849
|
+
font-family: ${variables_default.monoFontFamily};
|
|
4850
|
+
}
|
|
4851
|
+
`;
|
|
4852
|
+
ExpandedJsonTreeContainer.displayName = "ExpandedJsonTreeContainer";
|
|
4853
|
+
var ExpandableTableRow = styled_components_default(Table_default.Row)`
|
|
4854
|
+
${({ backgroundColor }) => backgroundColor && styled_components_exports.css`
|
|
4855
|
+
td[data-test='expand'] {
|
|
4856
|
+
background-color: ${backgroundColor} !important;
|
|
4857
|
+
}
|
|
4858
|
+
`}
|
|
4859
|
+
|
|
4860
|
+
td[data-test='expand'] button {
|
|
4861
|
+
background-color: transparent !important;
|
|
4862
|
+
}
|
|
4863
|
+
`;
|
|
4864
|
+
ExpandableTableRow.displayName = "ExpandableTableRow";
|
|
4865
|
+
var ExpandedContentRow = styled_components_default(Table_default.Row)`
|
|
4866
|
+
${({ backgroundColor, color }) => (backgroundColor || color) && styled_components_exports.css`
|
|
4867
|
+
td {
|
|
4868
|
+
${backgroundColor ? `background-color: ${backgroundColor};` : ""}
|
|
4869
|
+
${color ? `color: ${color};` : ""}
|
|
4870
|
+
}
|
|
4871
|
+
`}
|
|
4872
|
+
`;
|
|
4873
|
+
ExpandedContentRow.displayName = "ExpandedContentRow";
|
|
4536
4874
|
var withEmptyTableMessage = (Viz) => {
|
|
4537
4875
|
const Wrapper = (props) => {
|
|
4538
4876
|
const {
|
|
@@ -4649,7 +4987,8 @@ var PureTable = (props) => {
|
|
|
4649
4987
|
mode,
|
|
4650
4988
|
headerVisibility,
|
|
4651
4989
|
font,
|
|
4652
|
-
fontSize
|
|
4990
|
+
fontSize,
|
|
4991
|
+
showColumnAsExpandedJson
|
|
4653
4992
|
} = _a;
|
|
4654
4993
|
const [columns, setColumns] = react_exports.useState(columnFormat);
|
|
4655
4994
|
const containerRef = react_exports.useRef(null);
|
|
@@ -4672,6 +5011,14 @@ var PureTable = (props) => {
|
|
|
4672
5011
|
setColumns(columnFormat);
|
|
4673
5012
|
}
|
|
4674
5013
|
}, [columnFormat, mode, stringifiedColumnFormat]);
|
|
5014
|
+
const expandedRowJson = react_exports.useMemo(() => {
|
|
5015
|
+
const rowJsonValues = Array.isArray(showColumnAsExpandedJson) ? showColumnAsExpandedJson : [showColumnAsExpandedJson];
|
|
5016
|
+
return rowJsonValues.map(parseExpandedJson);
|
|
5017
|
+
}, [showColumnAsExpandedJson]);
|
|
5018
|
+
const hasExpandableRows = react_exports.useMemo(
|
|
5019
|
+
() => expandedRowJson.some((rowJson) => rowJson.isExpandable),
|
|
5020
|
+
[expandedRowJson]
|
|
5021
|
+
);
|
|
4675
5022
|
const TableHead = useTableHead(headerVisibility);
|
|
4676
5023
|
const debouncedDrilldown = react_exports.useMemo(
|
|
4677
5024
|
() => debounce_default((e, payload) => {
|
|
@@ -4759,7 +5106,7 @@ var PureTable = (props) => {
|
|
|
4759
5106
|
);
|
|
4760
5107
|
const handleResizeColumn = (_event, payload) => {
|
|
4761
5108
|
setResizing(true);
|
|
4762
|
-
const updatedCF = columns;
|
|
5109
|
+
const updatedCF = __spreadValues({}, columns);
|
|
4763
5110
|
const field = payload.columnId;
|
|
4764
5111
|
updatedCF[field] = __spreadProps(__spreadValues({}, updatedCF[field]), {
|
|
4765
5112
|
width: Math.max(payload.width, MINIMUM_COLUMN_SIZE)
|
|
@@ -4782,6 +5129,15 @@ var PureTable = (props) => {
|
|
|
4782
5129
|
const isFullyFixed = visibleHeaderCells.length === numberOfFixedHeaders;
|
|
4783
5130
|
const isHeaderHidden = headerVisibility === "none";
|
|
4784
5131
|
const onSortToUse = isResizing ? lodash_exports.noop : onSort;
|
|
5132
|
+
const handlePaginationSkipLink = (event) => {
|
|
5133
|
+
event.preventDefault();
|
|
5134
|
+
moveFocusInto(containerRef.current, '[data-test="table-pagination"]', event);
|
|
5135
|
+
};
|
|
5136
|
+
const handleTableSkipLink = (event) => {
|
|
5137
|
+
event.preventDefault();
|
|
5138
|
+
moveFocusOutside(containerRef.current, '[data-test="table-container"]', event);
|
|
5139
|
+
};
|
|
5140
|
+
const footerVisibleHeaderCells = tableHeader.cells.filter((c) => c.showCell !== false);
|
|
4785
5141
|
const renderFooterRow = (key, dataAttr) => {
|
|
4786
5142
|
const rows = ((tableFooter == null ? void 0 : tableFooter.rows) || []).filter((r) => r && r.key === key);
|
|
4787
5143
|
if (rows.length === 0) return null;
|
|
@@ -4792,24 +5148,35 @@ var PureTable = (props) => {
|
|
|
4792
5148
|
"data-test": dataAttr,
|
|
4793
5149
|
"data-row-index": key === "footer-totals" ? "0" : "1"
|
|
4794
5150
|
},
|
|
4795
|
-
(row.cells || []).map((c, idx) => {
|
|
4796
|
-
var _a2, _b2, _c2;
|
|
5151
|
+
(row.cells || []).filter((c) => c.showCell !== false).map((c, idx) => {
|
|
5152
|
+
var _a2, _b2, _c2, _d;
|
|
5153
|
+
const headerCell = footerVisibleHeaderCells[idx];
|
|
5154
|
+
const explicitWidth = headerCell && ((_a2 = columns[headerCell.value]) == null ? void 0 : _a2.width);
|
|
5155
|
+
const colWidth = explicitWidth && explicitWidth !== "auto" ? explicitWidth : void 0;
|
|
4797
5156
|
return /* @__PURE__ */ react_exports.createElement(
|
|
4798
5157
|
Table_default.Cell,
|
|
4799
5158
|
{
|
|
4800
5159
|
key: `${key}-cell-${c.key || idx}`,
|
|
4801
5160
|
"data-test": "cell",
|
|
4802
|
-
style: __spreadProps(__spreadValues({}, c.style), {
|
|
4803
|
-
backgroundColor: ((
|
|
4804
|
-
}),
|
|
5161
|
+
style: __spreadValues(__spreadProps(__spreadValues({}, c.style), {
|
|
5162
|
+
backgroundColor: ((_b2 = tableHeader.style) == null ? void 0 : _b2.backgroundColor) || ((_c2 = tableHeader.style) == null ? void 0 : _c2.color)
|
|
5163
|
+
}), colWidth !== void 0 && { width: colWidth }),
|
|
4805
5164
|
align: c.align || "right"
|
|
4806
5165
|
},
|
|
4807
|
-
(
|
|
5166
|
+
(_d = c.value) != null ? _d : ""
|
|
4808
5167
|
);
|
|
4809
5168
|
})
|
|
4810
5169
|
));
|
|
4811
5170
|
};
|
|
4812
|
-
return /* @__PURE__ */ react_exports.createElement(VizTableContainer, { backgroundColor, ref: containerRef, "data-test": "table-container" }, /* @__PURE__ */ react_exports.createElement(
|
|
5171
|
+
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(
|
|
5172
|
+
StyledSkipLink,
|
|
5173
|
+
{
|
|
5174
|
+
"data-test": "skip-link-pagination",
|
|
5175
|
+
to: "#pagination",
|
|
5176
|
+
onClick: handlePaginationSkipLink
|
|
5177
|
+
},
|
|
5178
|
+
(0, i18n_exports._)("Skip to table pagination")
|
|
5179
|
+
) : 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
5180
|
SUITableContainer,
|
|
4814
5181
|
{
|
|
4815
5182
|
ref: containerRefInner,
|
|
@@ -4827,6 +5194,7 @@ var PureTable = (props) => {
|
|
|
4827
5194
|
{
|
|
4828
5195
|
resizableFillLayout: true,
|
|
4829
5196
|
headType: isHeaderHidden ? void 0 : "inline",
|
|
5197
|
+
rowExpansion: hasExpandableRows ? "multi" : "none",
|
|
4830
5198
|
innerStyle: tableInnerStyle,
|
|
4831
5199
|
outerStyle: tableOuterStyle,
|
|
4832
5200
|
onClick: tableCellClickHandler,
|
|
@@ -4873,42 +5241,68 @@ var PureTable = (props) => {
|
|
|
4873
5241
|
);
|
|
4874
5242
|
}
|
|
4875
5243
|
)),
|
|
4876
|
-
/* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map(
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
5244
|
+
/* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map((row) => {
|
|
5245
|
+
var _a2;
|
|
5246
|
+
const expandedRowData = expandedRowJson[row.index];
|
|
5247
|
+
const expandedJson = (_a2 = expandedRowData == null ? void 0 : expandedRowData.json) != null ? _a2 : null;
|
|
5248
|
+
const expandedRowColors = getExpandedRowColors(row);
|
|
5249
|
+
const expansionRow = (expandedRowData == null ? void 0 : expandedRowData.isExpandable) ? /* @__PURE__ */ react_exports.createElement(
|
|
5250
|
+
ExpandedContentRow,
|
|
5251
|
+
__spreadValues({
|
|
5252
|
+
key: `${row.key}-expanded`,
|
|
5253
|
+
"data-test": "expanded-json-row"
|
|
5254
|
+
}, expandedRowColors),
|
|
5255
|
+
/* @__PURE__ */ react_exports.createElement(Table_default.Cell, { colSpan: visibleHeaderCells.length }, /* @__PURE__ */ react_exports.createElement(ExpandedJsonTreeContainer, null, expandedJson === null ? null : /* @__PURE__ */ react_exports.createElement(
|
|
5256
|
+
JSONTree_default,
|
|
4881
5257
|
{
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
cell.header
|
|
4886
|
-
)
|
|
5258
|
+
json: expandedJson,
|
|
5259
|
+
defaultExpanded: true,
|
|
5260
|
+
overflow: "wrap"
|
|
4887
5261
|
}
|
|
4888
|
-
)
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
5262
|
+
)))
|
|
5263
|
+
) : void 0;
|
|
5264
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
5265
|
+
ExpandableTableRow,
|
|
5266
|
+
__spreadValues({
|
|
5267
|
+
key: row.key,
|
|
5268
|
+
expansionRow
|
|
5269
|
+
}, expandedRowColors),
|
|
5270
|
+
row.cells.filter((c) => c.showCell).map((cell) => {
|
|
5271
|
+
var _a3, _b2;
|
|
5272
|
+
return /* @__PURE__ */ react_exports.createElement(SwitchTableCell, { key: cell.key, type: cell.cellType }, /* @__PURE__ */ react_exports.createElement(
|
|
5273
|
+
TextCell,
|
|
5274
|
+
{
|
|
5275
|
+
cell,
|
|
5276
|
+
useMouseOverEffect: getUseMouseOverEffect(
|
|
5277
|
+
props,
|
|
5278
|
+
cell.header
|
|
5279
|
+
)
|
|
5280
|
+
}
|
|
5281
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
5282
|
+
SparklineCell,
|
|
5283
|
+
{
|
|
5284
|
+
cell,
|
|
5285
|
+
useMouseOverEffect: getUseMouseOverEffect(
|
|
5286
|
+
props,
|
|
5287
|
+
cell.header
|
|
5288
|
+
),
|
|
5289
|
+
width: (_b2 = (_a3 = columns[cell.header]) == null ? void 0 : _a3.width) != null ? _b2 : "auto"
|
|
5290
|
+
}
|
|
5291
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
5292
|
+
ArrayCell,
|
|
5293
|
+
{
|
|
5294
|
+
cell,
|
|
5295
|
+
useMouseOverEffect: getUseMouseOverEffect(
|
|
5296
|
+
props,
|
|
5297
|
+
cell.header
|
|
5298
|
+
)
|
|
5299
|
+
}
|
|
5300
|
+
));
|
|
5301
|
+
})
|
|
5302
|
+
);
|
|
5303
|
+
}), tableFooter && showFooterTotals && renderFooterRow("footer-totals", "footer-row-totals"), tableFooter && showFooterPercentages && renderFooterRow("footer-percentages", "footer-row-percentages"))
|
|
4910
5304
|
)
|
|
4911
|
-
), isPaging ? /* @__PURE__ */ react_exports.createElement(PaginatorContainer,
|
|
5305
|
+
), isPaging ? /* @__PURE__ */ react_exports.createElement(PaginatorContainer, { "data-test": "table-pagination" }, width < COMPACT_PAGINATOR_WIDTH_THRESHOLD ? /* @__PURE__ */ react_exports.createElement(
|
|
4912
5306
|
Paginator_default.Compact,
|
|
4913
5307
|
{
|
|
4914
5308
|
current: paginatorProps.current,
|
|
@@ -4952,6 +5346,7 @@ PureTable.propTypes = {
|
|
|
4952
5346
|
mode: prop_types_exports.string,
|
|
4953
5347
|
onCellClick: prop_types_exports.func,
|
|
4954
5348
|
paginatorParams: PaginatorParamsPropTypes,
|
|
5349
|
+
showColumnAsExpandedJson: prop_types_exports.arrayOf(prop_types_exports.string),
|
|
4955
5350
|
showRowNumbers: prop_types_exports.bool,
|
|
4956
5351
|
showFooterTotals: prop_types_exports.bool,
|
|
4957
5352
|
sortParams: SortParamsPropTypes,
|
|
@@ -4986,6 +5381,7 @@ PureTable.defaultProps = {
|
|
|
4986
5381
|
isPaging: false,
|
|
4987
5382
|
onChange: lodash_exports.noop
|
|
4988
5383
|
},
|
|
5384
|
+
showColumnAsExpandedJson: [],
|
|
4989
5385
|
showRowNumbers: false,
|
|
4990
5386
|
showFooterTotals: false,
|
|
4991
5387
|
showFooterPercentages: false,
|
|
@@ -5064,31 +5460,46 @@ var withTableFooter = (Viz) => {
|
|
|
5064
5460
|
"dataSources",
|
|
5065
5461
|
"options"
|
|
5066
5462
|
]);
|
|
5067
|
-
var _a2;
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
footerKey = `footer${(0, id_exports.createDOMID)().replace(/-/g, "")}`;
|
|
5463
|
+
var _a2, _b2, _c;
|
|
5464
|
+
const footerKeyRef = react_exports.useRef(null);
|
|
5465
|
+
if (footerKeyRef.current === null) {
|
|
5466
|
+
let key = `footer${(0, id_exports.createDOMID)().replaceAll("-", "")}`;
|
|
5467
|
+
while (dataSources == null ? void 0 : dataSources[key]) {
|
|
5468
|
+
key = `footer${(0, id_exports.createDOMID)().replaceAll("-", "")}`;
|
|
5469
|
+
}
|
|
5470
|
+
footerKeyRef.current = key;
|
|
5076
5471
|
}
|
|
5077
|
-
const
|
|
5078
|
-
|
|
5079
|
-
|
|
5472
|
+
const footerKey = footerKeyRef.current;
|
|
5473
|
+
const fieldsMeta = react_exports.useMemo(
|
|
5474
|
+
() => {
|
|
5475
|
+
var _a3, _b3;
|
|
5476
|
+
return ((_b3 = (_a3 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a3.data) == null ? void 0 : _b3.fields) || [];
|
|
5477
|
+
},
|
|
5478
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5479
|
+
[JSON.stringify((_b2 = (_a2 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a2.data) == null ? void 0 : _b2.fields)]
|
|
5480
|
+
);
|
|
5481
|
+
const footerData = react_exports.useMemo(() => buildFooterDataFrames(fieldsMeta), [fieldsMeta]);
|
|
5482
|
+
const newDataSources = react_exports.useMemo(() => {
|
|
5483
|
+
var _a3;
|
|
5484
|
+
if (!((_a3 = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a3.data)) return dataSources;
|
|
5485
|
+
return __spreadProps(__spreadValues({}, dataSources), {
|
|
5486
|
+
[footerKey]: { data: footerData.footer }
|
|
5487
|
+
});
|
|
5488
|
+
}, [dataSources, footerKey, footerData]);
|
|
5080
5489
|
const showFooterTotals = Boolean(options == null ? void 0 : options.showFooterTotals);
|
|
5081
5490
|
const showFooterPercentages = Boolean(options == null ? void 0 : options.showFooterPercentages);
|
|
5082
|
-
|
|
5083
|
-
|
|
5491
|
+
const newOptions = react_exports.useMemo(() => {
|
|
5492
|
+
if (!showFooterTotals && !showFooterPercentages) {
|
|
5493
|
+
return options;
|
|
5494
|
+
}
|
|
5084
5495
|
const columnFormat = __spreadValues({}, (options == null ? void 0 : options.columnFormat) || {});
|
|
5085
5496
|
const fieldNames = (fieldsMeta || []).map((f) => f && (f.name || f)).filter(Boolean);
|
|
5086
5497
|
fieldNames.forEach((fieldName) => {
|
|
5087
|
-
var _a3,
|
|
5498
|
+
var _a3, _b3;
|
|
5088
5499
|
if (!fieldName || fieldName === "#") return;
|
|
5089
5500
|
const existingFooter = (_a3 = columnFormat == null ? void 0 : columnFormat[fieldName]) == null ? void 0 : _a3.footer;
|
|
5090
5501
|
if (typeof existingFooter === "undefined") {
|
|
5091
|
-
const dataDsl = (
|
|
5502
|
+
const dataDsl = (_b3 = columnFormat == null ? void 0 : columnFormat[fieldName]) == null ? void 0 : _b3.data;
|
|
5092
5503
|
let configToken = null;
|
|
5093
5504
|
if (typeof dataDsl === "string") {
|
|
5094
5505
|
const m = /formatByType\(([^)]+)\)/.exec(dataDsl);
|
|
@@ -5100,7 +5511,7 @@ var withTableFooter = (Viz) => {
|
|
|
5100
5511
|
footer: footerDsl
|
|
5101
5512
|
});
|
|
5102
5513
|
} else if (typeof existingFooter === "string") {
|
|
5103
|
-
const updatedFooterDsl = existingFooter.
|
|
5514
|
+
const updatedFooterDsl = existingFooter.replaceAll(/>\s*footer\w*/g, `> ${footerKey}`);
|
|
5104
5515
|
if (updatedFooterDsl !== existingFooter) {
|
|
5105
5516
|
columnFormat[fieldName] = __spreadProps(__spreadValues({}, columnFormat[fieldName] || {}), {
|
|
5106
5517
|
footer: updatedFooterDsl
|
|
@@ -5108,7 +5519,10 @@ var withTableFooter = (Viz) => {
|
|
|
5108
5519
|
}
|
|
5109
5520
|
}
|
|
5110
5521
|
});
|
|
5111
|
-
|
|
5522
|
+
return __spreadProps(__spreadValues({}, options), { columnFormat });
|
|
5523
|
+
}, [options, fieldsMeta, showFooterTotals, showFooterPercentages, footerKey]);
|
|
5524
|
+
if (!((_c = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _c.data)) {
|
|
5525
|
+
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources, options }, otherProps));
|
|
5112
5526
|
}
|
|
5113
5527
|
return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({ dataSources: newDataSources, options: newOptions }, otherProps));
|
|
5114
5528
|
};
|