@splunk/visualizations 27.4.0 → 28.0.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.config.js +26 -21
- package/Area.config.js.map +3 -3
- package/Area.js +88 -36
- package/Area.js.map +3 -3
- package/Bar.config.js +25 -21
- package/Bar.config.js.map +3 -3
- package/Bar.js +83 -37
- package/Bar.js.map +3 -3
- package/Bubble.config.js +46 -44
- package/Bubble.config.js.map +4 -4
- package/Bubble.js +83 -54
- package/Bubble.js.map +4 -4
- package/CHANGELOG.external.md +54 -7
- package/ChoroplethSvg.config.js +47 -43
- package/ChoroplethSvg.config.js.map +4 -4
- package/ChoroplethSvg.js +72 -45
- package/ChoroplethSvg.js.map +4 -4
- package/Column.config.js +22 -20
- package/Column.config.js.map +3 -3
- package/Column.js +76 -33
- package/Column.js.map +3 -3
- package/Ellipse.config.js +16 -7
- package/Ellipse.config.js.map +2 -2
- package/Ellipse.js +104 -20
- package/Ellipse.js.map +4 -4
- package/Events.config.js +38 -27
- package/Events.config.js.map +4 -4
- package/Events.js +122 -101
- package/Events.js.map +4 -4
- package/FEATUREFLAGS.md +9 -7
- package/FillerGauge.config.js +20 -13
- package/FillerGauge.config.js.map +3 -3
- package/FillerGauge.js +76 -27
- package/FillerGauge.js.map +4 -4
- package/Image.config.js +5 -6
- package/Image.config.js.map +2 -2
- package/Image.js +29 -14
- package/Image.js.map +2 -2
- package/Line.config.js +22 -20
- package/Line.config.js.map +3 -3
- package/Line.js +84 -35
- package/Line.js.map +3 -3
- package/LinkGraph.config.js +39 -46
- package/LinkGraph.config.js.map +3 -3
- package/LinkGraph.js +70 -50
- package/LinkGraph.js.map +3 -3
- package/MIGRATION.md +169 -40
- package/Map.config.js +47 -13
- package/Map.config.js.map +4 -4
- package/Map.js +350 -159
- package/Map.js.map +4 -4
- package/Markdown.config.js +4 -5
- package/Markdown.config.js.map +2 -2
- package/Markdown.js +117 -72
- package/Markdown.js.map +3 -3
- package/MarkerGauge.config.js +14 -12
- package/MarkerGauge.config.js.map +3 -3
- package/MarkerGauge.js +107 -69
- package/MarkerGauge.js.map +4 -4
- package/ParallelCoordinates.config.js +14 -12
- package/ParallelCoordinates.config.js.map +3 -3
- package/ParallelCoordinates.js +113 -59
- package/ParallelCoordinates.js.map +3 -3
- package/Pie.config.js +51 -38
- package/Pie.config.js.map +4 -4
- package/Pie.js +116 -88
- package/Pie.js.map +4 -4
- package/Punchcard.config.js +36 -34
- package/Punchcard.config.js.map +4 -4
- package/Punchcard.js +153 -87
- package/Punchcard.js.map +4 -4
- package/README.internal.md +15 -15
- package/README.md +10 -10
- package/Rectangle.config.js +16 -7
- package/Rectangle.config.js.map +2 -2
- package/Rectangle.js +103 -20
- package/Rectangle.js.map +4 -4
- package/Sankey.config.js +69 -17
- package/Sankey.config.js.map +4 -4
- package/Sankey.js +212 -82
- package/Sankey.js.map +4 -4
- package/Scatter.config.js +44 -42
- package/Scatter.config.js.map +3 -3
- package/Scatter.js +84 -56
- package/Scatter.js.map +3 -3
- package/SingleValue.config.js +32 -18
- package/SingleValue.config.js.map +4 -4
- package/SingleValue.js +238 -94
- package/SingleValue.js.map +4 -4
- package/SingleValueBasic.js +1 -0
- package/SingleValueBasic.js.map +2 -2
- package/SingleValueIcon.config.js +22 -11
- package/SingleValueIcon.config.js.map +2 -2
- package/SingleValueIcon.js +85 -29
- package/SingleValueIcon.js.map +2 -2
- package/SingleValueRadial.config.js +34 -23
- package/SingleValueRadial.config.js.map +3 -3
- package/SingleValueRadial.js +90 -49
- package/SingleValueRadial.js.map +4 -4
- package/SparkLine.js +153 -49
- package/SparkLine.js.map +2 -2
- package/Table.config.js +71 -51
- package/Table.config.js.map +3 -3
- package/Table.js +282 -145
- package/Table.js.map +3 -3
- package/Timeline.config.js +36 -34
- package/Timeline.config.js.map +4 -4
- package/Timeline.js +67 -59
- package/Timeline.js.map +4 -4
- package/common/Charting.js +8 -3
- package/common/Charting.js.map +2 -2
- package/common/ChartingApi.js +1 -0
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +7 -2
- package/common/DocExampleWithVizSandbox.js.map +2 -2
- package/common/EventsDoc.js +31 -5
- package/common/EventsDoc.js.map +4 -4
- package/common/GaugeMajorTicks.js +4 -1
- package/common/GaugeMajorTicks.js.map +2 -2
- package/common/GaugeValueMarker.js +31 -3
- package/common/GaugeValueMarker.js.map +4 -4
- package/common/OptionsDoc.js +4 -1
- package/common/OptionsDoc.js.map +2 -2
- package/common/OverviewDoc.js +66 -50
- package/common/OverviewDoc.js.map +4 -4
- package/common/SplunkVisualization.js +1 -0
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +1 -0
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemedDefaults.js +67 -0
- package/common/ThemedDefaults.js.map +7 -0
- package/common/ThemesDoc.js +6 -9
- package/common/ThemesDoc.js.map +2 -2
- package/common/chartingUtils.js +12 -0
- package/common/chartingUtils.js.map +2 -2
- package/common/docUtils.js +6 -1
- package/common/docUtils.js.map +2 -2
- package/common/gaugeUtils.js +6 -1
- package/common/gaugeUtils.js.map +2 -2
- package/common/shapeUtils.js +87 -3
- package/common/shapeUtils.js.map +4 -4
- package/common/utils/configUtils.js +4 -5
- package/common/utils/configUtils.js.map +2 -2
- package/common/utils/dataUtils.js +1 -0
- package/common/utils/dataUtils.js.map +2 -2
- package/common/utils/featureFlagUtils.js +1 -0
- package/common/utils/featureFlagUtils.js.map +1 -1
- package/common/utils/hocUtils.js +1 -0
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/mapUtils.js +174 -48
- package/common/utils/mapUtils.js.map +4 -4
- package/common/utils/singleValueUtils.js +9 -3
- package/common/utils/singleValueUtils.js.map +2 -2
- package/common/utils/styleUtils.js +1 -0
- package/common/utils/styleUtils.js.map +1 -1
- package/common/utils/testHelper.js +1 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +1 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +1 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +25 -8
- package/common/withDashboardViz.js.map +2 -2
- package/package.json +37 -35
package/Table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright © 2020 Splunk Inc.
|
|
2
2
|
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
3
|
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
"use strict";
|
|
4
5
|
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __defProps = Object.defineProperties;
|
|
@@ -191,11 +192,9 @@ var configUtils_default = "default" in defaultImport13 ? defaultImport13.default
|
|
|
191
192
|
// src/common/utils/configUtils.ts
|
|
192
193
|
function enhanceConfig(vizConfig) {
|
|
193
194
|
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
194
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
195
|
-
(config2)
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
);
|
|
195
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map((config2) => {
|
|
196
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
197
|
+
});
|
|
199
198
|
return enhancedConfig;
|
|
200
199
|
}
|
|
201
200
|
function generatePrecisionValues(numPrecisionValues) {
|
|
@@ -208,6 +207,15 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
208
207
|
);
|
|
209
208
|
}
|
|
210
209
|
|
|
210
|
+
// src/common/ThemedDefaults.tsx
|
|
211
|
+
var defaultBackgroundColor = (props) => pick_default({
|
|
212
|
+
enterprise: {
|
|
213
|
+
dark: variables_default.black(props),
|
|
214
|
+
light: variables_default.white(props)
|
|
215
|
+
},
|
|
216
|
+
prisma: variables_default.backgroundColorSection(props)
|
|
217
|
+
})(props);
|
|
218
|
+
|
|
211
219
|
// src/Table/config.ts
|
|
212
220
|
var dataContract = {
|
|
213
221
|
requiredDataSources: [
|
|
@@ -314,7 +322,10 @@ var textAlignConfigTable = {
|
|
|
314
322
|
option: "tableFormat.align",
|
|
315
323
|
editorProps: {
|
|
316
324
|
values: [
|
|
317
|
-
{
|
|
325
|
+
{
|
|
326
|
+
label: (0, i18n_exports._)("Auto"),
|
|
327
|
+
value: "> table | type() | matchValue(tableAlignByType)"
|
|
328
|
+
},
|
|
318
329
|
{ label: (0, i18n_exports._)("Left"), value: "left", icon: TextAlignLeft_default },
|
|
319
330
|
{ label: (0, i18n_exports._)("Center"), value: "center", icon: TextAlignCenter_default },
|
|
320
331
|
{ label: (0, i18n_exports._)("Right"), value: "right", icon: TextAlignRight_default }
|
|
@@ -365,13 +376,7 @@ var sequentialColorConfig = [
|
|
|
365
376
|
];
|
|
366
377
|
var matchColorConfig = [{ match: "", value: "#5C33FF" }];
|
|
367
378
|
var themes = {
|
|
368
|
-
defaultBackgroundColor
|
|
369
|
-
enterprise: {
|
|
370
|
-
dark: variables_default.black(props),
|
|
371
|
-
light: variables_default.backgroundColor(props)
|
|
372
|
-
},
|
|
373
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
374
|
-
})(props),
|
|
379
|
+
defaultBackgroundColor,
|
|
375
380
|
defaultHeaderBackgroundColor: (props) => pick_default({
|
|
376
381
|
enterprise: {
|
|
377
382
|
dark: variables_default.gray20(props),
|
|
@@ -391,7 +396,7 @@ var themes = {
|
|
|
391
396
|
dark: "#0D1012",
|
|
392
397
|
light: variables_default.backgroundColor(props)
|
|
393
398
|
},
|
|
394
|
-
prisma: variables_default.backgroundColorSidebar(props)
|
|
399
|
+
prisma: { dark: variables_default.backgroundColorSidebar(props), light: variables_default.white(props) }
|
|
395
400
|
})(props),
|
|
396
401
|
textColor: (props) => pick_default({
|
|
397
402
|
enterprise: variables_default.textColor(props),
|
|
@@ -407,10 +412,7 @@ var themes = {
|
|
|
407
412
|
prisma: variables_default.contentColorInverted(props)
|
|
408
413
|
})(props)
|
|
409
414
|
};
|
|
410
|
-
var backgroundColorPaletteSet = /* @__PURE__ */ new Set([
|
|
411
|
-
...colorConstants_exports.COLOR_EDITOR_PALETTE,
|
|
412
|
-
...(0, lodash_exports.map)(themes, (t) => (0, lodash_exports.get)(t, "defaultBackgroundColor"))
|
|
413
|
-
]);
|
|
415
|
+
var backgroundColorPaletteSet = /* @__PURE__ */ new Set([...colorConstants_exports.COLOR_EDITOR_PALETTE]);
|
|
414
416
|
var EDITOR_LABEL_WIDTH = 100;
|
|
415
417
|
var editorConfig = [
|
|
416
418
|
{
|
|
@@ -486,7 +488,10 @@ var editorConfig = [
|
|
|
486
488
|
editor: "editor.select",
|
|
487
489
|
editorProps: {
|
|
488
490
|
values: [
|
|
489
|
-
{
|
|
491
|
+
{
|
|
492
|
+
label: (0, i18n_exports._)("Proportional (Default)"),
|
|
493
|
+
value: "proportional"
|
|
494
|
+
},
|
|
490
495
|
{ label: (0, i18n_exports._)("Monospace"), value: "monospace" }
|
|
491
496
|
],
|
|
492
497
|
labelPosition: "top",
|
|
@@ -501,10 +506,22 @@ var editorConfig = [
|
|
|
501
506
|
editor: "editor.select",
|
|
502
507
|
editorProps: {
|
|
503
508
|
values: [
|
|
504
|
-
{
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
509
|
+
{
|
|
510
|
+
label: (0, i18n_exports._)("Extra Small (font 10px, row 24px)"),
|
|
511
|
+
value: "extraSmall"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
label: (0, i18n_exports._)("Small (font 12px, row 24px)"),
|
|
515
|
+
value: "small"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
label: (0, i18n_exports._)("Default (font 14px, row 32px)"),
|
|
519
|
+
value: "default"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
label: (0, i18n_exports._)("Large (font 16px, row 36px)"),
|
|
523
|
+
value: "large"
|
|
524
|
+
}
|
|
508
525
|
],
|
|
509
526
|
labelPosition: "top",
|
|
510
527
|
labelWidth: EDITOR_LABEL_WIDTH
|
|
@@ -602,7 +619,10 @@ var editorConfig = [
|
|
|
602
619
|
editor: "editor.radioBar",
|
|
603
620
|
editorProps: {
|
|
604
621
|
values: [
|
|
605
|
-
{
|
|
622
|
+
{
|
|
623
|
+
label: (0, i18n_exports._)("Off"),
|
|
624
|
+
value: false
|
|
625
|
+
},
|
|
606
626
|
{ label: (0, i18n_exports._)("On"), value: true }
|
|
607
627
|
]
|
|
608
628
|
}
|
|
@@ -1026,9 +1046,14 @@ var Item = styled_components_default.div.attrs(({ width }) => ({
|
|
|
1026
1046
|
position: relative;
|
|
1027
1047
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor}};
|
|
1028
1048
|
`;
|
|
1029
|
-
var FixSizeItem = styled_components_default.div.attrs(
|
|
1030
|
-
|
|
1031
|
-
|
|
1049
|
+
var FixSizeItem = styled_components_default.div.attrs(
|
|
1050
|
+
({
|
|
1051
|
+
width,
|
|
1052
|
+
height
|
|
1053
|
+
}) => ({
|
|
1054
|
+
style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
|
|
1055
|
+
})
|
|
1056
|
+
)`
|
|
1032
1057
|
position: relative;
|
|
1033
1058
|
flex-direction: column;
|
|
1034
1059
|
flex: 1;
|
|
@@ -1062,7 +1087,7 @@ var withFixedSizeContainer = (Viz) => {
|
|
|
1062
1087
|
FixSizeItem,
|
|
1063
1088
|
{
|
|
1064
1089
|
"data-test": "fix-size-item",
|
|
1065
|
-
"data-splunk-visualization-version": "
|
|
1090
|
+
"data-splunk-visualization-version": "28.0.0 - 0c5f07712",
|
|
1066
1091
|
width,
|
|
1067
1092
|
height,
|
|
1068
1093
|
backgroundColor
|
|
@@ -1128,7 +1153,7 @@ var Cover = styled_components_default.div`
|
|
|
1128
1153
|
bottom: 0;
|
|
1129
1154
|
`;
|
|
1130
1155
|
var Blocker = styled_components_default.div.attrs({
|
|
1131
|
-
"data-splunk-visualization-version": "
|
|
1156
|
+
"data-splunk-visualization-version": "28.0.0 - 0c5f07712"
|
|
1132
1157
|
})`
|
|
1133
1158
|
position: relative;
|
|
1134
1159
|
width: 100%;
|
|
@@ -1497,7 +1522,12 @@ var useGetXAndYFields = ({
|
|
|
1497
1522
|
y2Fields: options.y2 ? "> y2 | getField()" : void 0,
|
|
1498
1523
|
fieldTypes: "> primary | getType()"
|
|
1499
1524
|
};
|
|
1500
|
-
const {
|
|
1525
|
+
const {
|
|
1526
|
+
xField = "",
|
|
1527
|
+
yFields = [],
|
|
1528
|
+
y2Fields = [],
|
|
1529
|
+
fieldTypes
|
|
1530
|
+
} = Options_exports.Options.evaluate(
|
|
1501
1531
|
{ options: optionsToEvaluate, context },
|
|
1502
1532
|
dataSourcesWithOnlyOnePoint,
|
|
1503
1533
|
() => {
|
|
@@ -1778,7 +1808,9 @@ var withDashboardViz = (opts) => {
|
|
|
1778
1808
|
return result;
|
|
1779
1809
|
}
|
|
1780
1810
|
} catch (e) {
|
|
1781
|
-
|
|
1811
|
+
if (e instanceof Error) {
|
|
1812
|
+
console.error(`unexpected error evaluating options: ${e.message}`);
|
|
1813
|
+
}
|
|
1782
1814
|
return {};
|
|
1783
1815
|
}
|
|
1784
1816
|
return {};
|
|
@@ -1837,7 +1869,11 @@ var withDashboardViz = (opts) => {
|
|
|
1837
1869
|
if (ev && ev.payload) {
|
|
1838
1870
|
payload = ev.payload;
|
|
1839
1871
|
}
|
|
1840
|
-
return onEventTrigger({
|
|
1872
|
+
return onEventTrigger({
|
|
1873
|
+
originalEvent: ev,
|
|
1874
|
+
payload,
|
|
1875
|
+
type: eventName
|
|
1876
|
+
});
|
|
1841
1877
|
};
|
|
1842
1878
|
if (parentKeys) {
|
|
1843
1879
|
for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
@@ -1955,11 +1991,11 @@ var empty = {};
|
|
|
1955
1991
|
var getOverflowStyles = ({ textOverflow }) => {
|
|
1956
1992
|
return textOverflowStyles[textOverflow] || empty;
|
|
1957
1993
|
};
|
|
1958
|
-
var generateKey = (
|
|
1994
|
+
var generateKey = (i = "", value = "") => `${value}-${i}`;
|
|
1959
1995
|
var getTextOverflowType = (columnFormat, columnId, currentColumn) => getAttributeFromColumnFormat("textOverflow", columnFormat, columnId, currentColumn);
|
|
1960
1996
|
var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInternalFields) => {
|
|
1961
1997
|
const ret = {
|
|
1962
|
-
key: generateKey(value, i),
|
|
1998
|
+
key: generateKey(value, String(i)),
|
|
1963
1999
|
value,
|
|
1964
2000
|
align: "left",
|
|
1965
2001
|
columnId,
|
|
@@ -2288,21 +2324,19 @@ var useTable = (tableArgs = {}) => {
|
|
|
2288
2324
|
}
|
|
2289
2325
|
const tableHeader = {
|
|
2290
2326
|
visibility: visualization_schemas_exports.validHeaderVisibilities.indexOf(headerVisibility) >= 0 ? headerVisibility : "inline",
|
|
2291
|
-
cells: table.map(
|
|
2292
|
-
(
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
);
|
|
2302
|
-
}
|
|
2303
|
-
return generateHeader("", "", i, columnFormat, tableFormat, showInternalFields);
|
|
2327
|
+
cells: table.map((f, i) => {
|
|
2328
|
+
if (i < headers.length) {
|
|
2329
|
+
return generateHeader(
|
|
2330
|
+
headers[i],
|
|
2331
|
+
columnIds[i],
|
|
2332
|
+
i,
|
|
2333
|
+
columnFormat,
|
|
2334
|
+
tableFormat,
|
|
2335
|
+
showInternalFields
|
|
2336
|
+
);
|
|
2304
2337
|
}
|
|
2305
|
-
|
|
2338
|
+
return generateHeader("", "", i, columnFormat, tableFormat, showInternalFields);
|
|
2339
|
+
}),
|
|
2306
2340
|
style: {
|
|
2307
2341
|
backgroundColor: (0, lodash_exports.has)(tableFormat, "headerBackgroundColor") && (0, colorUtils_exports.isColor)(tableFormat.headerBackgroundColor) && tableFormat.headerBackgroundColor || void 0,
|
|
2308
2342
|
color: (0, lodash_exports.has)(tableFormat, "headerColor") && (0, colorUtils_exports.isColor)(tableFormat.headerColor) && tableFormat.headerColor || void 0
|
|
@@ -2442,6 +2476,7 @@ var StyledTooltip = styled_components_default.div`
|
|
|
2442
2476
|
padding: 3px 8px;
|
|
2443
2477
|
font-size: 12px;
|
|
2444
2478
|
`;
|
|
2479
|
+
var preventDefault = (e) => e.preventDefault();
|
|
2445
2480
|
var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
2446
2481
|
constructor(props, ...rest) {
|
|
2447
2482
|
super(props, ...rest);
|
|
@@ -2452,21 +2487,99 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2452
2487
|
});
|
|
2453
2488
|
this.state = {
|
|
2454
2489
|
anchor: null,
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
tooltip: null
|
|
2490
|
+
activeIndex: 0,
|
|
2491
|
+
hoveredIndex: null,
|
|
2492
|
+
componentIsFocused: false
|
|
2459
2493
|
};
|
|
2460
|
-
this.titleId = (0, id_exports.createDOMID)();
|
|
2494
|
+
this.titleId = (0, id_exports.createDOMID)("sparkline-title");
|
|
2495
|
+
this.pointRefs = [];
|
|
2496
|
+
this.containerRef = react_default.createRef();
|
|
2497
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
2498
|
+
this.handleMouseOver = this.handleMouseOver.bind(this);
|
|
2499
|
+
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
|
2500
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
2501
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
2502
|
+
}
|
|
2503
|
+
handleFocus(event) {
|
|
2504
|
+
const { target } = event;
|
|
2505
|
+
const { pointIndex: pointIndexStr } = target.dataset || {};
|
|
2506
|
+
const { activeIndex, componentIsFocused, hoveredIndex } = this.state;
|
|
2507
|
+
if (pointIndexStr !== void 0) {
|
|
2508
|
+
const pointIndex = parseInt(pointIndexStr, 10);
|
|
2509
|
+
if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
|
|
2510
|
+
this.setState({
|
|
2511
|
+
activeIndex: pointIndex,
|
|
2512
|
+
hoveredIndex: null,
|
|
2513
|
+
componentIsFocused: true
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
} else if (this.pointRefs.length > 0) {
|
|
2517
|
+
const indexToFocus = activeIndex ? Math.min(this.pointRefs.length - 1, activeIndex) : 0;
|
|
2518
|
+
this.pointRefs[indexToFocus].focus();
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
handleBlur(event) {
|
|
2522
|
+
if (this.containerRef.current && !this.containerRef.current.contains(event.relatedTarget)) {
|
|
2523
|
+
this.setState({ componentIsFocused: false });
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
handleKeyDown(event) {
|
|
2527
|
+
const { data } = this.props;
|
|
2528
|
+
const { activeIndex } = this.state;
|
|
2529
|
+
const numPoints = data.length;
|
|
2530
|
+
if (numPoints === 0) {
|
|
2531
|
+
return;
|
|
2532
|
+
}
|
|
2533
|
+
const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
|
|
2534
|
+
if (!allowedKeys.includes(event.key)) {
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
let newIndex = activeIndex;
|
|
2538
|
+
switch (event.key) {
|
|
2539
|
+
case "Home":
|
|
2540
|
+
newIndex = 0;
|
|
2541
|
+
break;
|
|
2542
|
+
case "End":
|
|
2543
|
+
newIndex = numPoints - 1;
|
|
2544
|
+
break;
|
|
2545
|
+
case "ArrowLeft":
|
|
2546
|
+
newIndex = Math.max(0, activeIndex - 1);
|
|
2547
|
+
break;
|
|
2548
|
+
case "ArrowRight":
|
|
2549
|
+
newIndex = Math.min(numPoints - 1, activeIndex + 1);
|
|
2550
|
+
break;
|
|
2551
|
+
default:
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
if (newIndex !== activeIndex) {
|
|
2555
|
+
event.preventDefault();
|
|
2556
|
+
if (this.pointRefs[newIndex]) {
|
|
2557
|
+
this.pointRefs[newIndex].focus();
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
handleMouseOver(event) {
|
|
2562
|
+
const pointIndexStr = event.target.dataset && event.target.dataset.pointIndex;
|
|
2563
|
+
if (pointIndexStr !== void 0) {
|
|
2564
|
+
const pointIndex = parseInt(pointIndexStr, 10);
|
|
2565
|
+
if (this.state.hoveredIndex !== pointIndex) {
|
|
2566
|
+
this.setState({ hoveredIndex: pointIndex });
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
handleMouseLeave() {
|
|
2571
|
+
if (this.state.hoveredIndex !== null) {
|
|
2572
|
+
this.setState({ hoveredIndex: null });
|
|
2573
|
+
}
|
|
2461
2574
|
}
|
|
2462
2575
|
getMax() {
|
|
2463
2576
|
const { data, acceptNull, yMax } = this.props;
|
|
2464
|
-
const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull(
|
|
2577
|
+
const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull()) : (0, lodash_exports.max)(data);
|
|
2465
2578
|
return yMax !== void 0 ? yMax : dataMax();
|
|
2466
2579
|
}
|
|
2467
2580
|
getMin() {
|
|
2468
2581
|
const { data, acceptNull, yMin } = this.props;
|
|
2469
|
-
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull(
|
|
2582
|
+
const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
|
|
2470
2583
|
return yMin !== void 0 ? yMin : dataMin();
|
|
2471
2584
|
}
|
|
2472
2585
|
/**
|
|
@@ -2546,15 +2659,14 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2546
2659
|
})).map((p) => [p.x, p.y]);
|
|
2547
2660
|
}
|
|
2548
2661
|
/**
|
|
2549
|
-
* Renders rect area for
|
|
2550
|
-
* render related cursor and tooltip.
|
|
2662
|
+
* Renders rect area for each datapoint for interactions and screen reader support
|
|
2551
2663
|
* @param {Array} points - array of points coordination.
|
|
2552
2664
|
* @param {Number} xMargin - margin of x axis.
|
|
2553
2665
|
* @return {Array} array of svg rect objects
|
|
2554
2666
|
* @private
|
|
2555
2667
|
*/
|
|
2556
2668
|
renderRect(points, xMargin) {
|
|
2557
|
-
const { data, height } = this.props;
|
|
2669
|
+
const { data, height, showTooltip } = this.props;
|
|
2558
2670
|
const xUnit = this.getXUnit(xMargin);
|
|
2559
2671
|
return points.map((p, i) => (
|
|
2560
2672
|
/* eslint-disable react/no-array-index-key */
|
|
@@ -2562,20 +2674,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2562
2674
|
"rect",
|
|
2563
2675
|
{
|
|
2564
2676
|
key: `${i}_${p[0]}`,
|
|
2677
|
+
role: "img",
|
|
2678
|
+
"aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
|
|
2565
2679
|
"data-test": `rect-${i}`,
|
|
2680
|
+
"data-point-index": i,
|
|
2681
|
+
tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
|
|
2682
|
+
ref: (el) => {
|
|
2683
|
+
this.pointRefs[i] = el;
|
|
2684
|
+
},
|
|
2566
2685
|
x: p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2,
|
|
2567
2686
|
y: 0,
|
|
2568
2687
|
width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
|
|
2569
2688
|
height,
|
|
2570
2689
|
style: { fillOpacity: 0 },
|
|
2571
|
-
|
|
2572
|
-
this.setState({
|
|
2573
|
-
open: data[i] !== null,
|
|
2574
|
-
rectArea: data[i] === null ? null : e.target,
|
|
2575
|
-
tooltip: data[i],
|
|
2576
|
-
currentPointX: p[0]
|
|
2577
|
-
});
|
|
2578
|
-
}
|
|
2690
|
+
onMouseDown: preventDefault
|
|
2579
2691
|
}
|
|
2580
2692
|
)
|
|
2581
2693
|
));
|
|
@@ -2611,22 +2723,16 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2611
2723
|
}
|
|
2612
2724
|
)));
|
|
2613
2725
|
}
|
|
2614
|
-
renderCursor() {
|
|
2615
|
-
const {
|
|
2616
|
-
|
|
2617
|
-
cursorStrokeWidth,
|
|
2618
|
-
cursorStrokeLinecap,
|
|
2619
|
-
cursorStrokeDasharray,
|
|
2620
|
-
height
|
|
2621
|
-
} = this.props;
|
|
2622
|
-
return this.state.rectArea !== null && /* @__PURE__ */ react_default.createElement(
|
|
2726
|
+
renderCursor(currentPointX, shouldRender) {
|
|
2727
|
+
const { cursorStroke, cursorStrokeWidth, cursorStrokeLinecap, cursorStrokeDasharray, height } = this.props;
|
|
2728
|
+
return shouldRender && /* @__PURE__ */ react_default.createElement(
|
|
2623
2729
|
"line",
|
|
2624
2730
|
{
|
|
2625
2731
|
"data-test": "cursor",
|
|
2626
2732
|
ref: this.handleCursorMount,
|
|
2627
|
-
x1:
|
|
2733
|
+
x1: currentPointX,
|
|
2628
2734
|
y1: 0,
|
|
2629
|
-
x2:
|
|
2735
|
+
x2: currentPointX,
|
|
2630
2736
|
y2: height,
|
|
2631
2737
|
style: {
|
|
2632
2738
|
stroke: cursorStroke,
|
|
@@ -2637,19 +2743,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2637
2743
|
}
|
|
2638
2744
|
);
|
|
2639
2745
|
}
|
|
2640
|
-
renderTooltip() {
|
|
2641
|
-
|
|
2746
|
+
renderTooltip(tooltipValue, isOpen) {
|
|
2747
|
+
const { anchor } = this.state;
|
|
2748
|
+
return /* @__PURE__ */ react_default.createElement(
|
|
2642
2749
|
Popover_default,
|
|
2643
2750
|
{
|
|
2644
2751
|
"data-test": "tooltip",
|
|
2645
|
-
open:
|
|
2646
|
-
anchor
|
|
2647
|
-
"data-test-value":
|
|
2752
|
+
open: isOpen,
|
|
2753
|
+
anchor,
|
|
2754
|
+
"data-test-value": tooltipValue,
|
|
2648
2755
|
appearance: "inverted",
|
|
2649
2756
|
defaultPlacement: "above",
|
|
2650
2757
|
animation: false
|
|
2651
2758
|
},
|
|
2652
|
-
/* @__PURE__ */ react_default.createElement(StyledTooltip, null,
|
|
2759
|
+
/* @__PURE__ */ react_default.createElement(StyledTooltip, null, tooltipValue)
|
|
2653
2760
|
);
|
|
2654
2761
|
}
|
|
2655
2762
|
/**
|
|
@@ -2720,39 +2827,69 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
|
|
|
2720
2827
|
width,
|
|
2721
2828
|
title
|
|
2722
2829
|
} = this.props;
|
|
2830
|
+
const { activeIndex, hoveredIndex, componentIsFocused } = this.state;
|
|
2723
2831
|
if (data.length === 0) {
|
|
2724
2832
|
return null;
|
|
2725
2833
|
}
|
|
2834
|
+
if (this.pointRefs.length !== data.length) {
|
|
2835
|
+
this.pointRefs.length = data.length;
|
|
2836
|
+
}
|
|
2726
2837
|
const xMargin = endDotRadius + endDotStrokeWidth / 2;
|
|
2727
2838
|
const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
|
|
2728
2839
|
const points = this.dataToPoints(xMargin, yMargin);
|
|
2729
2840
|
const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
|
|
2841
|
+
let currentPointX = null;
|
|
2842
|
+
let tooltipValue = null;
|
|
2843
|
+
let showCursorAndTooltip = false;
|
|
2844
|
+
let interactiveProps = {};
|
|
2845
|
+
if (showTooltip) {
|
|
2846
|
+
const isHovered = hoveredIndex !== null;
|
|
2847
|
+
const shouldDisplayInteractiveElements = (isHovered || componentIsFocused) && data.length > 0;
|
|
2848
|
+
if (shouldDisplayInteractiveElements) {
|
|
2849
|
+
const displayIndex = isHovered ? hoveredIndex : activeIndex;
|
|
2850
|
+
if (displayIndex !== null && displayIndex >= 0 && data.length > displayIndex && points.length > displayIndex) {
|
|
2851
|
+
const displayPointCoords = points[displayIndex];
|
|
2852
|
+
if (displayPointCoords) {
|
|
2853
|
+
[currentPointX] = displayPointCoords;
|
|
2854
|
+
}
|
|
2855
|
+
tooltipValue = data[displayIndex];
|
|
2856
|
+
showCursorAndTooltip = currentPointX !== null;
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
interactiveProps = {
|
|
2860
|
+
onKeyDown: this.handleKeyDown,
|
|
2861
|
+
onMouseOver: this.handleMouseOver,
|
|
2862
|
+
onMouseLeave: this.handleMouseLeave,
|
|
2863
|
+
onFocus: this.handleFocus,
|
|
2864
|
+
onBlur: this.handleBlur
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
|
|
2730
2868
|
return /* @__PURE__ */ react_default.createElement(
|
|
2731
2869
|
"div",
|
|
2732
|
-
__spreadValues({
|
|
2870
|
+
__spreadValues(__spreadValues({
|
|
2733
2871
|
"data-test": "line",
|
|
2734
2872
|
"data-test-type": isArea ? "area" : "line",
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
}, (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
2873
|
+
role: "group",
|
|
2874
|
+
ref: (el) => {
|
|
2875
|
+
this.containerRef.current = el;
|
|
2876
|
+
if (typeof elementRef === "function") {
|
|
2877
|
+
elementRef(el);
|
|
2878
|
+
} else if (elementRef && typeof elementRef === "object") {
|
|
2879
|
+
elementRef.current = el;
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
}, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
|
|
2745
2883
|
/* @__PURE__ */ react_default.createElement(
|
|
2746
2884
|
StyledSvg,
|
|
2747
2885
|
{
|
|
2748
2886
|
height,
|
|
2749
2887
|
width,
|
|
2750
|
-
role: "img",
|
|
2751
2888
|
"aria-labelledby": this.titleId,
|
|
2752
2889
|
"data-test": "sparkline-svg"
|
|
2753
2890
|
},
|
|
2754
|
-
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" },
|
|
2755
|
-
/* @__PURE__ */ react_default.createElement("g", null, this.renderCursor(), this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null,
|
|
2891
|
+
/* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
|
|
2892
|
+
/* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
|
|
2756
2893
|
)
|
|
2757
2894
|
);
|
|
2758
2895
|
}
|
|
@@ -2871,7 +3008,7 @@ var SparklineCell = ({
|
|
|
2871
3008
|
data = data.slice(1);
|
|
2872
3009
|
}
|
|
2873
3010
|
react_exports.useLayoutEffect(() => {
|
|
2874
|
-
setHeight(cellEl == null ? void 0 : cellEl.offsetHeight);
|
|
3011
|
+
setHeight((cellEl == null ? void 0 : cellEl.offsetHeight) || 20);
|
|
2875
3012
|
}, [cellEl]);
|
|
2876
3013
|
const cellStyle = react_exports.useMemo(
|
|
2877
3014
|
() => __spreadProps(__spreadValues({}, cell.style), {
|
|
@@ -2886,6 +3023,7 @@ var SparklineCell = ({
|
|
|
2886
3023
|
() => ({
|
|
2887
3024
|
paddingLeft: `${paddingLeftRight}px`,
|
|
2888
3025
|
paddingTop: `${paddingTopBottom}px`,
|
|
3026
|
+
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
2889
3027
|
width: width === "auto" ? `${(cellEl == null ? void 0 : cellEl.offsetWidth) - paddingLeftRight * 2}px` : `${width}px`,
|
|
2890
3028
|
height: `${height - paddingTopBottom * 2}px`
|
|
2891
3029
|
}),
|
|
@@ -2921,14 +3059,12 @@ var SparklineCell = ({
|
|
|
2921
3059
|
SparklineCell.displayName = "SparklineCell";
|
|
2922
3060
|
|
|
2923
3061
|
// src/Table/PureTable.tsx
|
|
2924
|
-
var MINIMUM_COLUMN_SIZE =
|
|
3062
|
+
var MINIMUM_COLUMN_SIZE = 60;
|
|
2925
3063
|
var INITIAL_UNSET_COLUMN_WIDTH = 90;
|
|
2926
3064
|
var NonVisibleTableHead = styled_components_default(Table_default.Head)`
|
|
2927
3065
|
pointer-events: none;
|
|
2928
3066
|
& [data-test='head-cell'] > div {
|
|
2929
|
-
|
|
2930
|
-
padding: 0;
|
|
2931
|
-
margin: 0;
|
|
3067
|
+
display: none;
|
|
2932
3068
|
}
|
|
2933
3069
|
`;
|
|
2934
3070
|
var FixedTableHead = styled_components_default(Table_default.Head)`
|
|
@@ -2945,10 +3081,7 @@ var TableHeadCell = styled_components_default(Table_default.HeadCell)`
|
|
|
2945
3081
|
`;
|
|
2946
3082
|
var VizTableContainer = styled_components_default.div`
|
|
2947
3083
|
box-sizing: border-box;
|
|
2948
|
-
padding: ${
|
|
2949
|
-
enterprise: variables_default.spacingHalf,
|
|
2950
|
-
prisma: variables_default.spacingSmall
|
|
2951
|
-
})};
|
|
3084
|
+
padding: ${variables_default.spacingSmall};
|
|
2952
3085
|
background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor};
|
|
2953
3086
|
display: flex;
|
|
2954
3087
|
flex-flow: column nowrap;
|
|
@@ -2971,11 +3104,9 @@ var SUITableContainer = styled_components_default.div`
|
|
|
2971
3104
|
box-sizing: border-box;
|
|
2972
3105
|
flex-grow: 1;
|
|
2973
3106
|
overflow: hidden;
|
|
3107
|
+
|
|
2974
3108
|
${({ width, height, isPaging, theme }) => {
|
|
2975
|
-
const padding =
|
|
2976
|
-
enterprise: variables_default.spacingHalf({ theme }),
|
|
2977
|
-
prisma: variables_default.spacingSmall({ theme })
|
|
2978
|
-
})({ theme });
|
|
3109
|
+
const padding = variables_default.spacingSmall({ theme });
|
|
2979
3110
|
const paddingOffset = parseInt(padding, 10) * 2;
|
|
2980
3111
|
return (0, style_exports.toDimension)({
|
|
2981
3112
|
width: width - paddingOffset,
|
|
@@ -2995,7 +3126,7 @@ var SUITableContainer = styled_components_default.div`
|
|
|
2995
3126
|
`}
|
|
2996
3127
|
|
|
2997
3128
|
${({ headerStyle }) => headerStyle && headerStyle.color && styled_components_exports.css`
|
|
2998
|
-
& [data-test='head-cell'] > button > span {
|
|
3129
|
+
& [data-test='head-cell'] > div > button > span {
|
|
2999
3130
|
color: ${headerStyle.color};
|
|
3000
3131
|
}
|
|
3001
3132
|
`}
|
|
@@ -3039,7 +3170,13 @@ var withEmptyTableMessage = (Viz) => {
|
|
|
3039
3170
|
headerVisibility,
|
|
3040
3171
|
showRowNumbers,
|
|
3041
3172
|
showInternalFields,
|
|
3042
|
-
tableFormat: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tableFormat), (tableFormat == null ? void 0 : tableFormat.headerAlign) && {
|
|
3173
|
+
tableFormat: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, tableFormat), (tableFormat == null ? void 0 : tableFormat.headerAlign) && {
|
|
3174
|
+
headerAlign: (0, lodash_exports.cloneDeep)(tableFormat.headerAlign)
|
|
3175
|
+
}), (tableFormat == null ? void 0 : tableFormat.align) && {
|
|
3176
|
+
align: (0, lodash_exports.cloneDeep)(tableFormat.align)
|
|
3177
|
+
}), (tableFormat == null ? void 0 : tableFormat.cellTypes) && {
|
|
3178
|
+
cellTypes: (0, lodash_exports.cloneDeep)(tableFormat.cellTypes)
|
|
3179
|
+
}), (tableFormat == null ? void 0 : tableFormat.data) && { data: (0, lodash_exports.cloneDeep)(tableFormat.data) }),
|
|
3043
3180
|
columnFormat,
|
|
3044
3181
|
paginationOffset: paginatorParams == null ? void 0 : paginatorParams.current,
|
|
3045
3182
|
count
|
|
@@ -3137,7 +3274,11 @@ var PureTable = (props) => {
|
|
|
3137
3274
|
);
|
|
3138
3275
|
const drilldownHandler = react_exports.useCallback(
|
|
3139
3276
|
(e) => {
|
|
3140
|
-
|
|
3277
|
+
var _a2;
|
|
3278
|
+
const element = (_a2 = e.target) == null ? void 0 : _a2.closest("[data-row-index]");
|
|
3279
|
+
if (!element) {
|
|
3280
|
+
return;
|
|
3281
|
+
}
|
|
3141
3282
|
const row = element.getAttribute("data-row-index");
|
|
3142
3283
|
const col = element.getAttribute("data-col-index");
|
|
3143
3284
|
const arrayIndex = element.getAttribute("data-array-index") || -1;
|
|
@@ -3191,9 +3332,6 @@ var PureTable = (props) => {
|
|
|
3191
3332
|
e.stopPropagation();
|
|
3192
3333
|
}
|
|
3193
3334
|
}, []);
|
|
3194
|
-
const handleEventHeadCellMouseUp = react_exports.useCallback(() => {
|
|
3195
|
-
setResizing(false);
|
|
3196
|
-
}, [setResizing]);
|
|
3197
3335
|
const handleKeyDown = (e) => {
|
|
3198
3336
|
if (e.keyCode !== 13) {
|
|
3199
3337
|
return;
|
|
@@ -3219,7 +3357,6 @@ var PureTable = (props) => {
|
|
|
3219
3357
|
if (mode === "edit") {
|
|
3220
3358
|
debouncedOnColumnFormatChange(updatedCF);
|
|
3221
3359
|
}
|
|
3222
|
-
setResizing(false);
|
|
3223
3360
|
};
|
|
3224
3361
|
const fontMapped = fontMap[font] || fontMap.proportional;
|
|
3225
3362
|
const fontSizeMapped = fontSizeMap[fontSize] || fontSizeMap.default;
|
|
@@ -3235,6 +3372,7 @@ var PureTable = (props) => {
|
|
|
3235
3372
|
}).length;
|
|
3236
3373
|
const isFullyFixed = visibleHeaderCells.length === numberOfFixedHeaders;
|
|
3237
3374
|
const isHeaderHidden = headerVisibility === "none";
|
|
3375
|
+
const onSortToUse = isResizing ? lodash_exports.noop : onSort;
|
|
3238
3376
|
return /* @__PURE__ */ react_exports.createElement(
|
|
3239
3377
|
VizTableContainer,
|
|
3240
3378
|
{
|
|
@@ -3297,9 +3435,8 @@ var PureTable = (props) => {
|
|
|
3297
3435
|
sortDir: sortKey === currentSortKey ? currentSortDir : "none",
|
|
3298
3436
|
width: (_b2 = (_a2 = columns[value]) == null ? void 0 : _a2.width) != null ? _b2 : INITIAL_UNSET_COLUMN_WIDTH,
|
|
3299
3437
|
onMouseDown: handleEventHeadCellMouseDown,
|
|
3300
|
-
onMouseUp: handleEventHeadCellMouseUp,
|
|
3301
3438
|
value,
|
|
3302
|
-
onSort:
|
|
3439
|
+
onSort: showRowNumbers && value === "#" || isHeaderHidden ? null : onSortToUse,
|
|
3303
3440
|
resizable: !isHeaderHidden,
|
|
3304
3441
|
style: showRowNumbers && value === "#" ? __spreadProps(__spreadValues({}, style), { cursor: "auto" }) : style,
|
|
3305
3442
|
headerVisibility
|
|
@@ -3308,31 +3445,29 @@ var PureTable = (props) => {
|
|
|
3308
3445
|
}
|
|
3309
3446
|
)),
|
|
3310
3447
|
/* @__PURE__ */ react_exports.createElement(Table_default.Body, null, tableBody.rows.map(
|
|
3311
|
-
(row) => /* @__PURE__ */ react_exports.createElement(Table_default.Row, { key: row.key }, row.cells.filter((c) => c.showCell).map(
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
}
|
|
3335
|
-
))
|
|
3448
|
+
(row) => /* @__PURE__ */ react_exports.createElement(Table_default.Row, { key: row.key }, row.cells.filter((c) => c.showCell).map((cell) => {
|
|
3449
|
+
var _a2, _b2;
|
|
3450
|
+
return /* @__PURE__ */ react_exports.createElement(SwitchTableCell, { key: cell.key, type: cell.cellType }, /* @__PURE__ */ react_exports.createElement(
|
|
3451
|
+
TextCell,
|
|
3452
|
+
{
|
|
3453
|
+
cell,
|
|
3454
|
+
useMouseOverEffect: !!onCellClick
|
|
3455
|
+
}
|
|
3456
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3457
|
+
SparklineCell,
|
|
3458
|
+
{
|
|
3459
|
+
cell,
|
|
3460
|
+
useMouseOverEffect: !!onCellClick,
|
|
3461
|
+
width: (_b2 = (_a2 = columns[cell.header]) == null ? void 0 : _a2.width) != null ? _b2 : "auto"
|
|
3462
|
+
}
|
|
3463
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
3464
|
+
ArrayCell,
|
|
3465
|
+
{
|
|
3466
|
+
cell,
|
|
3467
|
+
useMouseOverEffect: !!onCellClick
|
|
3468
|
+
}
|
|
3469
|
+
));
|
|
3470
|
+
}))
|
|
3336
3471
|
))
|
|
3337
3472
|
)
|
|
3338
3473
|
),
|
|
@@ -3436,7 +3571,9 @@ var computeVizProps = (_a) => {
|
|
|
3436
3571
|
(color) => color || themeTextColor
|
|
3437
3572
|
);
|
|
3438
3573
|
}
|
|
3439
|
-
vizProps.columnFormat[columnKey] = __spreadValues(__spreadValues(__spreadValues({}, vizProps.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
3574
|
+
vizProps.columnFormat[columnKey] = __spreadValues(__spreadValues(__spreadValues({}, vizProps.columnFormat[columnKey]), columnProperties.rowBackgroundColors && {
|
|
3575
|
+
rowBackgroundColors
|
|
3576
|
+
}), columnProperties.rowColors && { rowColors });
|
|
3440
3577
|
});
|
|
3441
3578
|
vizProps.columnIds = (_d = (_c = (_b = (_a2 = vizProps.dataSources) == null ? void 0 : _a2.primary) == null ? void 0 : _b.data) == null ? void 0 : _c.fields.map((field) => {
|
|
3442
3579
|
var _a3;
|